Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
57898aa
Graphics.useMatrixTranslation: route g.translate through impl matrix
shai-almog May 16, 2026
7d92332
Graphics matrix mode: drop shadow accumulator, fix bypass-Graphics ca…
shai-almog May 16, 2026
6e863a4
Graphics matrix mode: restore shadow + preserve framework translate a…
shai-almog May 16, 2026
b737efb
Graphics matrix mode: matrix is the single source of truth, callsites…
shai-almog May 16, 2026
b849f19
Use short names: import Transform, drop com.codename1.ui.Graphics. FQN
shai-almog May 16, 2026
283dcbc
Graphics matrix mode: route setTransform(null) through impl.resetAffine
shai-almog May 16, 2026
9b4ea68
Graphics matrix mode: keep userTransform null to prevent stale-state …
shai-almog May 16, 2026
7af8707
Android: AsyncGraphics.translateMatrix must queue an op like scale/ro…
shai-almog May 17, 2026
501fc54
Graphics matrix mode: conjugate user setTransform around framework an…
shai-almog May 17, 2026
c237464
Graphics matrix mode: subtract framework anchor from peer clearRect c…
shai-almog May 17, 2026
9a5ae15
Graphics matrix mode: framework anchor accessor + revert snapshot-res…
shai-almog May 17, 2026
bc0da53
Revert "Graphics matrix mode: framework anchor accessor + revert snap…
shai-almog May 17, 2026
6680735
Revert Graphics matrix mode to known-good state (commit 7af87077f)
shai-almog May 17, 2026
e421712
Graphics matrix mode: framework-anchor accessor + setTransform conjug…
shai-almog May 17, 2026
1cb1121
Android matrix mode: peer screen position + 2 goldens
shai-almog May 17, 2026
1b485e6
JS port: reset canvas transform at drain start (matrix-mode title fix)
shai-almog May 17, 2026
9dc21d4
JS port: BufferedGraphics override for translateMatrix
shai-almog May 17, 2026
4af4225
JS port goldens: promote matrix-mode renderings (17 + 1 new)
shai-almog May 17, 2026
59d3b14
iOS Metal: save/restore currentTransform on mutable side-trip + 5 gol…
shai-almog May 18, 2026
0652645
iOS Metal: targeted mutable-image drain in gausianBlurImage
shai-almog May 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,19 @@ public void paintDirty() {
continue;
}
paintQueueTemp[iter] = null;
wrapper.translate(-wrapper.getTranslateX(), -wrapper.getTranslateY());
// Reset wrapper graphics to a clean state before painting
// the next queued animation. matrixFrameworkTranslateX
// returns the right anchor (xTranslate in legacy mode,
// matrixFrameworkX in matrix mode) so the translate-based
// reset brings the wrapper to identity in both modes.
// resetAffine() then clears any leftover user
// scale/rotate; in matrix mode it also re-applies the
// framework anchor it had just zeroed, but since we
// already translate(-tx, -ty)'d to zero it stays at
// identity for the upcoming paintComponent.
int wtx = wrapper.matrixFrameworkTranslateX();
int wty = wrapper.matrixFrameworkTranslateY();
wrapper.translate(-wtx, -wty);
wrapper.resetAffine();
wrapper.setClip(0, 0, dwidth, dheight);
if (ani instanceof Component) {
Expand Down
23 changes: 18 additions & 5 deletions CodenameOne/src/com/codename1/maps/MapComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.codename1.ui.Graphics;
import com.codename1.ui.Image;
import com.codename1.ui.ImageFactory;
import com.codename1.ui.Transform;
import com.codename1.ui.events.ActionEvent;
import com.codename1.ui.events.ActionListener;
import com.codename1.ui.geom.Dimension;
Expand Down Expand Up @@ -269,11 +270,23 @@ public void paintBackground(Graphics g) {
tx = -tx * (float) (scaleX - getWidth()) / sx;
float ty = (float) zoomCenterY / (float) getHeight();
ty = -ty * (float) (scaleY - getHeight()) / sy;
g.translate((int) tx, (int) ty);
g.scale(sx, sy);
paintmap(g);
g.resetAffine();
g.translate(-(int) tx, -(int) ty);
if (Graphics.useMatrixTranslation) {
// Matrix mode: resetAffine wipes the impl matrix to
// identity, which destroys the framework painting-chain
// translates the matrix carries. Use save/restore the
// impl matrix around the scale + user-translate instead.
Transform savedMatrix = g.getTransform();
g.translate((int) tx, (int) ty);
g.scale(sx, sy);
paintmap(g);
g.setTransform(savedMatrix);
} else {
g.translate((int) tx, (int) ty);
g.scale(sx, sy);
paintmap(g);
g.resetAffine();
g.translate(-(int) tx, -(int) ty);
}
} else {
g.translate(-translateX, -translateY);
paintmap(g);
Expand Down
14 changes: 8 additions & 6 deletions CodenameOne/src/com/codename1/ui/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -3031,9 +3031,12 @@ void internalPaintImpl(Graphics g, boolean paintIntersects) {
public void paintIntersectingComponentsAbove(Graphics g) {
Container parent = getParent();
Component component = this;
int tx = g.getTranslateX();
int ty = g.getTranslateY();

// Snapshot-reset translate -- matrixFrameworkTranslateX returns
// xTranslate in legacy mode and the matrixFrameworkX shadow in
// matrix mode so the parent walk below paints each ancestor at
// its screen-absolute position.
int tx = g.matrixFrameworkTranslateX();
int ty = g.matrixFrameworkTranslateY();
g.translate(-tx, -ty);
int x1 = getAbsoluteX() + getScrollX();
int y1 = getAbsoluteY() + getScrollY();
Expand All @@ -3056,7 +3059,6 @@ public void paintIntersectingComponentsAbove(Graphics g) {
parent = parent.getParent();
}
g.translate(tx, ty);

}

/// Paints the UI for the scrollbars on the component, this will be invoked only
Expand Down Expand Up @@ -3344,8 +3346,8 @@ private void drawPainters(Graphics g, Component par, Component c,
paintBackgroundImpl(tg);
putClientProperty("$FLAT", i);
}
int tx = g.getTranslateX();
int ty = g.getTranslateY();
int tx = g.matrixFrameworkTranslateX();
int ty = g.matrixFrameworkTranslateY();
g.translate(-tx + absX, -ty + absY);
g.drawImage(i, 0, 0);
g.translate(tx - absX, ty - absY);
Expand Down
8 changes: 6 additions & 2 deletions CodenameOne/src/com/codename1/ui/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -2186,8 +2186,12 @@ public void paint(Graphics g) {
paintElevatedPane(g);
}

int tx = g.getTranslateX();
int ty = g.getTranslateY();
// Snapshot-reset translate so glass/tensile draw at screen-
// absolute coords. matrixFrameworkTranslateX returns the right
// anchor for both modes (legacy: xTranslate; matrix mode:
// matrixFrameworkX shadow).
int tx = g.matrixFrameworkTranslateX();
int ty = g.matrixFrameworkTranslateY();
g.translate(-tx, -ty);
if (sidemenuBarTranslation > 0) {
g.translate(sidemenuBarTranslation, 0);
Expand Down
8 changes: 4 additions & 4 deletions CodenameOne/src/com/codename1/ui/FontImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -7796,8 +7796,8 @@ protected void drawImage(Graphics g, Object nativeGraphics, int x, int y) {
g.concatenateAlpha(fgAlpha);
}
if (rotated != 0) {
int tX = g.getTranslateX();
int tY = g.getTranslateY();
int tX = g.matrixFrameworkTranslateX();
int tY = g.matrixFrameworkTranslateY();
g.translate(-tX, -tY);
g.rotate((float) Math.toRadians(rotated % 360), tX + x + width / 2, tY + y + height / 2);
g.drawString(text, tX + x + width / 2 - w / 2, tY + y + height / 2 - h / 2);
Expand Down Expand Up @@ -7837,8 +7837,8 @@ protected void drawImage(Graphics g, Object nativeGraphics, int x, int y, int w,
}
//int paddingPixels = Display.getInstance().convertToPixels(padding, true);
if (rotated != 0) {
int tX = g.getTranslateX();
int tY = g.getTranslateY();
int tX = g.matrixFrameworkTranslateX();
int tY = g.matrixFrameworkTranslateY();
g.translate(-tX, -tY);
g.rotate((float) Math.toRadians(rotated % 360), tX + x + w / 2, tY + y + h / 2);
g.drawString(text, tX + x + w / 2 - ww / 2, tY + y);
Expand Down
9 changes: 7 additions & 2 deletions CodenameOne/src/com/codename1/ui/Form.java
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,13 @@ void paintGlassImpl(Graphics g) {
return;
}
if (glassPane != null) {
int tx = g.getTranslateX();
int ty = g.getTranslateY();
// matrixFrameworkTranslateX returns xTranslate in legacy mode
// and the matrixFrameworkX shadow in matrix mode; the translate-
// based snapshot reset brings the impl matrix to identity in
// both modes so glassPane.paint draws at the form's screen
// coords via getBounds().
int tx = g.matrixFrameworkTranslateX();
int ty = g.matrixFrameworkTranslateY();
g.translate(-tx, -ty);
glassPane.paint(g, getBounds());
g.translate(tx, ty);
Expand Down
Loading
Loading