Acknowledged
over 1 year ago

setMatrix bug?

Had some affinetransforms which worked well in sim but not on my FR265 device (on-device log file reports ciq 4.2.4).

Wittled down to a test case which works in sim but not on device (bitmap not showing up how it should):

translateMatrix.initialize();
translateMatrix.setMatrix([
    1.0, 0.0, 0.0,
    0.0, 1.0, 0.0]);
dc.drawBitmap2(200, 200, myPngBitmap, {
  :transform => translateMatrix,
  :filterMode => Graphics.FILTER_MODE_BILINEAR
});

AFAIK it should be equal to the following code, which does work as expected on-device:

translateMatrix.initialize();
translateMatrix.setToTranslation(0.0, 0.0);
dc.drawBitmap2(200, 200, myPngBitmap, {
  :transform => translateMatrix,
  :filterMode => Graphics.FILTER_MODE_BILINEAR
});

I've had to change my real code from doing multiple operations in setMatrix/concatenate to using separate translate/scale/rotate operations.

Parents
  • Just a note while I'm here looking at your issue... Outside of calling your base class initialize, you should never call a classes initialize method directly. If you want a matrix, use a new expression to allocate and initialize it.

    var translateMatrix = new Graphics.AffineTransform();
    translateMatrix.setMatrix([
      ...
    ]);
    

    If you want to re-initialize an object, either allocate a new one and assign, or call a normal method to get the state you want.

Comment
  • Just a note while I'm here looking at your issue... Outside of calling your base class initialize, you should never call a classes initialize method directly. If you want a matrix, use a new expression to allocate and initialize it.

    var translateMatrix = new Graphics.AffineTransform();
    translateMatrix.setMatrix([
      ...
    ]);
    

    If you want to re-initialize an object, either allocate a new one and assign, or call a normal method to get the state you want.

Children