Acknowledged
CIQQA-3184

Bug Report: Issue with Dc.setFill() Function

It appears that the Dc.setFill() function is not working as expected.
Below is some sample code that draws a toggle switch and demonstrates the issue:

    public function setEnabled( isEnabled as Boolean ) as Void {
        var dc = _bufferedBitmap.getDc();
        dc.clear();

        if( isEnabled ) {
            //dc.setColor( 0xe64a19, Graphics.COLOR_BLACK );
            dc.setFill( 0xe64a19 );
        } else {
            //dc.setColor( Graphics.COLOR_LT_GRAY, Graphics.COLOR_BLACK );
            dc.setFill( Graphics.COLOR_LT_GRAY );
        }
        var radius = dc.getWidth() / 2;
        var lowerYCenter = dc.getHeight() - radius;
        dc.fillCircle( radius, radius, radius );
        dc.fillCircle( radius, lowerYCenter, radius );
        dc.fillRectangle( 0, radius, dc.getWidth(), lowerYCenter - radius );

        //dc.setColor( Graphics.COLOR_GREEN, Graphics.COLOR_BLACK );
        dc.setFill( Graphics.COLOR_GREEN );

        var toggleCenter = isEnabled ? radius : lowerYCenter;
        dc.fillCircle( radius, toggleCenter, radius * 0.8 );
    }

Expected Behavior:
When running the code using setColor(), the result looks correct and as intended.

Observed Behavior:
When using Dc.setFill(), the rendered output does not appear as it should.

  • It seems that Dc.fillCircle() is ignoring the fill color set by Dc.setFill().

  • Additionally, a call to setFill() after a fillRectangle() call still appears to affect the already drawn rectangle, which should not happen.

  • You're absolutely right, sorry I missed that earlier. I tested it, and using the 0xAARRGGBB format works as expected.

  • As far as I can tell, the issue with the above code is that it is leaving the alpha bits empty on the color passed to setFill, which tells the render code to draw the objects fully transparent. The documentation explicitly says this function takes a color in a 32-bit integer format 0xAARRGGBB, but you're only providing 0xRRGGBB.

    developer.garmin.com/.../Dc.html

    You left out the code for allocating and initializing the _bufferedBitmap, but I'm assuming you cleared it to green after initialization, which would make sense given the screenshots provided. You're showing none of the red circles, red rectangle, or green circle have drawn and the corners are filled in solid green instead of black. This only makes sense if the full buffered bitmap was set to green and nothing else rendered.

  • I have been testing in tne simulator with an epix2pro47mm. No „has“, see the code above. 

  • Which devices(s) as setFill isn't available on all devices?

    Is there a "has" involved to prevent a crash on those?

  • Expected Behavior:

    (Note: I am not color blind - the use of green in the example is intentional and purely for demonstrating the issue.)

    Observed Behavior: