Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force repaint in NativeGraphicsSource to fix broken animation #445

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion org.eclipse.draw2d/src/org/eclipse/draw2d/Animation.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private void doTest(Snippet annotation, Statement statement) throws Throwable {
robot = new GraphicalRobot(graph);
shell = graph.getShell();
// Wait for layout to be applied
waitEventLoop(0);
azoitl marked this conversation as resolved.
Show resolved Hide resolved
waitEventLoop(10);
// Run the actual test
statement.evaluate();
} catch (Throwable e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;

import org.junit.Ignore;
import org.junit.Test;

/**
Expand Down Expand Up @@ -110,7 +109,6 @@ protected boolean hasGraph(Lookup lookup, Snippet snippet) throws ReflectiveOper
* @see <a href="https://github.com/eclipse/gef-classic/issues/376">here</a>
*/
@Test
@Ignore
@Snippet(type = AnimationSnippet.class)
public void testAnimationSnippet() {
AtomicInteger repaintCount = new AtomicInteger();
Expand Down
Loading