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 6b20da4

Browse filesBrowse files
committed
Merge pull request #1691 from dmcdougall/fix_svg_flip2
Fix svg flipping (again)
2 parents 527fd07 + 1606edb commit 6b20da4
Copy full SHA for 6b20da4

File tree

Expand file treeCollapse file tree

2 files changed

+5
-12
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-12
lines changed

‎lib/matplotlib/backends/backend_svg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_svg.py
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,12 +743,9 @@ def draw_image(self, gc, x, y, im, dx=None, dy=None, transform=None):
743743
self.writer.start(u'g', attrib={u'clip-path': u'url(#%s)' % clipid})
744744

745745
trans = [1,0,0,1,0,0]
746-
h,w = im.get_size_out()
747746
if rcParams['svg.image_noscale']:
748747
trans = list(im.get_matrix())
749748
trans[5] = -trans[5]
750-
trans[3] = -trans[3]
751-
y += h
752749
attrib[u'transform'] = generate_transform([(u'matrix', tuple(trans))])
753750
assert trans[1] == 0
754751
assert trans[2] == 0

‎src/_image.cpp

Copy file name to clipboardExpand all lines: src/_image.cpp
+5-9Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -440,15 +440,11 @@ Image::resize(const Py::Tuple& args, const Py::Dict& kwargs)
440440

441441
case NEAREST:
442442
{
443-
if (colsIn == numcols && rowsIn == numrows) {
444-
memcpy(bufferOut, bufferIn, colsIn * rowsIn * 4);
445-
} else {
446-
typedef agg::span_image_filter_rgba_nn<img_accessor_type, interpolator_type> span_gen_type;
447-
typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
448-
span_gen_type sg(ia, interpolator);
449-
renderer_type ri(rb, sa, sg);
450-
agg::render_scanlines(ras, sl, ri);
451-
}
443+
typedef agg::span_image_filter_rgba_nn<img_accessor_type, interpolator_type> span_gen_type;
444+
typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
445+
span_gen_type sg(ia, interpolator);
446+
renderer_type ri(rb, sa, sg);
447+
agg::render_scanlines(ras, sl, ri);
452448
}
453449
break;
454450

0 commit comments

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