diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-18 04:25:32 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-18 04:25:32 +0400 |
commit | 433f871f0f6bc68fbb1fffbdac42ef1bb8b5d019 (patch) | |
tree | f6a920d95309bfd69865ee942829f72ea4e3157c /source/blender/editors/interface/interface_icons.c | |
parent | c7c128f03b1a5bd95946ef5b2d1f9e46abd76ce7 (diff) |
bugfix [#24302] Ctrl+Click Extrude gets old mouse events
double click didnt check mouse distance moved so you could click twice in different areas of the screen very fast and generate a double click event which had old mouse coords copied into it but was sent to an operator set to run on single click (because the double click wasnt handled).
Also added MEM_name_ptr function (included in debug mode only), prints the name of allocated memory.
used for debugging where events came from.
Diffstat (limited to 'source/blender/editors/interface/interface_icons.c')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 39e062a13aa..0ade3e6199f 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -864,13 +864,6 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), glPixelTransferf(GL_GREEN_SCALE, rgb[1]); glPixelTransferf(GL_BLUE_SCALE, rgb[2]); } - - if(is_preview == 0) { - /* position */ - glRasterPos2f(x,y); - } - - /* draw */ /* rect contains image in 'rendersize', we only scale if needed */ if(rw!=w && rh!=h) { @@ -881,8 +874,14 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), rect= ima->rect; } - if(is_preview) glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, rect); - else glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect); + /* draw */ + if(is_preview) { + glaDrawPixelsSafe(x, y, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, rect); + } + else { + glRasterPos2f(x, y); + glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect); + } if(ima) IMB_freeImBuf(ima); |