curvedraw
changeset 4:9f75208b81cd
allow panning while inserting control points
don't scale text with the viewport
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 17 Dec 2015 07:22:14 +0200 |
parents | bf78387a9925 |
children | 2b7ae76c173f b625f0575d66 |
files | src/app.cc src/curve.h |
diffstat | 2 files changed, 8 insertions(+), 9 deletions(-) [+] |
line diff
1.1 --- a/src/app.cc Thu Dec 17 07:10:10 2015 +0200 1.2 +++ b/src/app.cc Thu Dec 17 07:22:14 2015 +0200 1.3 @@ -79,9 +79,6 @@ 1.4 if(new_curve) { 1.5 draw_curve(new_curve); 1.6 } 1.7 - if(weight_label) { 1.8 - weight_label->draw(); 1.9 - } 1.10 1.11 #ifdef DRAW_MOUSE_POINTER 1.12 glPointSize(6.0); 1.13 @@ -90,6 +87,13 @@ 1.14 glVertex2f(mouse_pointer.x, mouse_pointer.y); 1.15 glEnd(); 1.16 #endif 1.17 + 1.18 + glMatrixMode(GL_MODELVIEW); 1.19 + glLoadIdentity(); 1.20 + 1.21 + if(weight_label) { 1.22 + weight_label->draw(); 1.23 + } 1.24 } 1.25 1.26 static void draw_grid(float sz, float sep, float alpha) 1.27 @@ -379,11 +383,9 @@ 1.28 if(new_curve) { 1.29 new_curve->move_point(new_curve->size() - 1, snap(uv)); 1.30 post_redisplay(); 1.31 - return; 1.32 } 1.33 - // from this point on we're definitely not in new-curve mode 1.34 1.35 - if(!bnstate) { 1.36 + if(!new_curve && !bnstate) { 1.37 // not dragging, highlight curve under mouse 1.38 point_hit_test(uv, &hover_curve, &sel_pidx); 1.39 post_redisplay();
2.1 --- a/src/curve.h Thu Dec 17 07:10:10 2015 +0200 2.2 +++ b/src/curve.h Thu Dec 17 07:22:14 2015 +0200 2.3 @@ -43,9 +43,6 @@ 2.4 Vector2 interpolate(float t, CurveType type) const; 2.5 Vector2 interpolate(float t) const; 2.6 Vector2 operator ()(float t) const; 2.7 - 2.8 - void draw(int res = -1) const; 2.9 - void draw_cp(float sz = -1.0f) const; 2.10 }; 2.11 2.12 #endif // CURVE_H_