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 f05182d

Browse filesBrowse files
committed
Merge pull request #3806 from mdboom/image-orientation-macosx
OSX backend. 2D histograms are flipped vertically
2 parents a220e1f + 1b8a930 commit f05182d
Copy full SHA for f05182d

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed

‎src/_macosx.m

Copy file name to clipboardExpand all lines: src/_macosx.m
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3222,9 +3222,15 @@ static void _data_provider_release(void* info, const void* data, size_t size)
32223222

32233223
CGFloat deviceScale = _get_device_scale(cr);
32243224

3225-
CGContextDrawImage(cr, CGRectMake(x, y, ncols/deviceScale, nrows/deviceScale), bitmap);
3225+
CGContextSaveGState(cr);
3226+
CGContextTranslateCTM(cr, 0, y + nrows/deviceScale);
3227+
CGContextScaleCTM(cr, 1.0, -1.0);
3228+
3229+
CGContextDrawImage(cr, CGRectMake(x, 0, ncols/deviceScale, nrows/deviceScale), bitmap);
32263230
CGImageRelease(bitmap);
32273231

3232+
CGContextRestoreGState(cr);
3233+
32283234
Py_INCREF(Py_None);
32293235
return Py_None;
32303236
}

0 commit comments

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