diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-08-12 12:10:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-08-12 12:10:26 +0400 |
commit | bbe4f83de21b4a4b88c5985821aa13866092bd47 (patch) | |
tree | 16b6a131758b761cdceea1769ba88ff45afa72d2 | |
parent | 33e4972cdb1eecdfb5a8833dbd6565dcca866eb8 (diff) |
only draw the xor line when the mouse moves (border moving).
This is the only thing that made software GL unuseable, and would even hang blender when using some debugging tools.
The lag was noticibel on some cheap graphics cards also.
There is a problem with blenders events that means the mouse movement events are sent while the mouse button release event isnt for some time. This could make resizing a border take a fairly long time... 4-10sec.
even though this is a workaround, only redrawing when the mouse is moved is logical.
-rw-r--r-- | source/blender/src/editscreen.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index 6bca8b32322..814985cb165 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -3113,7 +3113,7 @@ static void splitarea_interactive(ScrArea *area, ScrEdge *onedge) } } - if (first || mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { + if (first || (dir=='v' && mval[0]!=mvalo[0]) || (dir=='h' && mval[1]!=mvalo[1])) { if (!first) { scrarea_draw_splitpoint(sa, dir, fac); } @@ -3389,7 +3389,7 @@ static void moveareas(ScrEdge *edge) { ScrVert *v1; ScrArea *sa; - short mvalo[2]; + short mvalo[2], mval_prev=-1; short edge_start, edge_end, edge_position; short bigger, smaller, headery, areaminy; int delta, doit; @@ -3478,13 +3478,18 @@ static void moveareas(ScrEdge *edge) short mval[2]; getmouseco_sc(mval); - - draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end); + if ((dir=='h' && mval_prev != mval[1]) || (dir=='v' && mval_prev != mval[0])) { + /* update the previous val with this one for comparison next loop */ + if (dir=='h') mval_prev = mval[1]; + else mval_prev = mval[0]; + + draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end); - delta= (dir=='h')?(mval[1]-mvalo[1]):(mval[0]-mvalo[0]); - delta= CLAMPIS(delta, -smaller, bigger); - draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end); - bglFlush(); + delta= (dir=='h')?(mval[1]-mvalo[1]):(mval[0]-mvalo[0]); + delta= CLAMPIS(delta, -smaller, bigger); + draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end); + bglFlush(); + } } else if (event==LEFTMOUSE) { doit= 1; |