Skip to content

Commit

Permalink
Fixed this really annoying bug: http://stackoverflow.com/questions/37…
Browse files Browse the repository at this point in the history
…986722/why-do-i-get-a-different-behviour-in-codename-one-simulator-than-on-a-real-andro

The graphics was scaled for the mutable image too when the simulator was in scale mode
  • Loading branch information
shai-almog committed Jun 24, 2016
1 parent 46139c3 commit 65ad28c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Ports/JavaSE/src/com/codename1/impl/javase/JavaSEPort.java
Expand Up @@ -4423,7 +4423,8 @@ public int getAlpha(Object graphics) {
public void drawString(Object graphics, String str, int x, int y) {
checkEDT();
Graphics2D nativeGraphics = getGraphics(graphics);
if (zoomLevel != 1) {
// the latter indicates mutable image graphics
if (zoomLevel != 1 && nativeGraphics != graphics) {
nativeGraphics = (Graphics2D) nativeGraphics.create();
nativeGraphics.setTransform(AffineTransform.getTranslateInstance(0, 0));
java.awt.Font currentFont = nativeGraphics.getFont();
Expand Down

0 comments on commit 65ad28c

Please sign in to comment.