diff --git a/org.eclipse.draw2d/src/org/eclipse/draw2d/Animation.java b/org.eclipse.draw2d/src/org/eclipse/draw2d/Animation.java index 6893d0119..beab126da 100644 --- a/org.eclipse.draw2d/src/org/eclipse/draw2d/Animation.java +++ b/org.eclipse.draw2d/src/org/eclipse/draw2d/Animation.java @@ -251,7 +251,7 @@ public static void run() { * @since 3.2 */ public static void run(int duration) { - if (state == 0) { + if (state == 0 || state == PLAYBACK) { return; } try { diff --git a/org.eclipse.draw2d/src/org/eclipse/draw2d/NativeGraphicsSource.java b/org.eclipse.draw2d/src/org/eclipse/draw2d/NativeGraphicsSource.java index f308d6414..2d2195e67 100644 --- a/org.eclipse.draw2d/src/org/eclipse/draw2d/NativeGraphicsSource.java +++ b/org.eclipse.draw2d/src/org/eclipse/draw2d/NativeGraphicsSource.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2024 IBM Corporation and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -56,6 +56,9 @@ public Graphics getGraphics(Rectangle r) { // canvas.update(); + // canvas.update() paints too much and only works on Windows. Use + // readAndDispatch() to only paint the redraw() event. + canvas.getDisplay().readAndDispatch(); return null; }