Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 32547c8

Browse filesBrowse files
committed
FIX: Add a 0-length timer to allow fast animations to redraw on macosx
The macosx backend would not update on flush_events calls due to the loop being run too fast for the view to update properly in the NSApp. Fix that by adding an unnoticeable RunLoop timer slowdown that allows the app to see the changes.
1 parent 4264233 commit 32547c8
Copy full SHA for 32547c8

File tree

Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed

‎src/_macosx.m

Copy file name to clipboardExpand all lines: src/_macosx.m
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ static CGFloat _get_device_scale(CGContextRef cr)
354354
static PyObject*
355355
FigureCanvas_flush_events(FigureCanvas* self)
356356
{
357+
// We need to allow the runloop to run very briefly
358+
// to allow the view to be displayed when used in a fast updating animation
359+
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.0]];
357360
[self->view displayIfNeeded];
358361
Py_RETURN_NONE;
359362
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.