clear() is not so clear for me...


The clear function seems to keep the pen color for drawing commands but not for fill commands?!

The following example does show all elements except the filled rectangle. This behaviour changes when the setColor() is done again after the clear() call.

dc.setColor(0xFFFF00,0x0000FF);
dc.clear();

// dc.setColor(0xFFFF00,0x0000FF);
dc.drawLine(0,0,240,240); // ok
dc.drawRectangle(0,60,20,200); // ok
dc.fillRectangle(0,60,240,20); // background color!

  • Former Member
    Former Member
    It appears that dc.clear() would internally corrupt the fill color (overwritten with the background color) prior to 2.3.0. This bug was corrected in the 2.3.0 release, so the latest SDK and any products updated to that VM should not exhibit the issue.

    What platform are you seeing this issue on?
  • Oooh...

    Didn't check with 2.3.2, have seen it with 2.2.6 (still use this SDK because it compiles fasterr and is portable, while 2.3.x need's to do lousy things to get a portable version) - sorry.
  • If you are having problems with 2.3.x SDKs and the way you do things, you really need to look at your own build environment, because it will only get worse and you'll miss out on bug fixes in the SDK.

    We're at 2.3.2 today, and I think it's a safe bet that Garmin is working on a new version as I type!

    Otherwise, you may keep running into other things that have been fixed a couple of SDKs back from what is current. You want to stay as current as you can when it comes to SDKs.