8000 FIX: gtk blitting by tacaswell · Pull Request #8687 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

FIX: gtk blitting #8687

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

Merged
merged 1 commit into from
May 31, 2017
Merged
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
FIX: gtk blitting
 - Resize (rather than reserve) stl vector which will serve as our
   buffer.
 - use `front` rather than `[0]` to get the first element
   to get the pointer

closes #8684
  • Loading branch information
tacaswell committed May 31, 2017
commit 1a483485f04d162dc85a31c1a60d3e371417172a
4 changes: 2 additions & 2 deletions src/_gtkagg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71, 59F3 8 +71,8 @@ static PyObject *Py_agg_to_gtk_drawable(PyObject *self, PyObject *args, PyObject
destwidth = (int)(rect.x2 - rect.x1);
destheight = (int)(rect.y2 - rect.y1);
deststride = destwidth * 4;
destbuffer.reserve(destheight * deststride);
destbufferptr = &destbuffer[0];
destbuffer.resize(destheight * deststride, 0);
destbufferptr = &destbuffer.front();

agg::rendering_buffer destrbuf;
destrbuf.attach(destbufferptr, destwidth, destheight, deststride);
Expand Down
0