Module: synfig/synfig Branch: genete_width_outline Commit: 479fec9db4b27c129294c3bb486feb88886472b6 URL: http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig/synfig;a=commit;h=479fec9db4b27c129294c3bb486feb88886472b6
Author: Carlos Lopez <[email protected]> Date: Sun Jan 30 18:38:00 2011 +0100 Fix Width tool: Now it shows the radius of influence and the point over the bline TODO: change the radius spinbutton to a distance widget. --- synfig-studio/src/gui/states/state_width.cpp | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/synfig-studio/src/gui/states/state_width.cpp b/synfig-studio/src/gui/states/state_width.cpp index 4226f7f..380cbc7 100644 --- a/synfig-studio/src/gui/states/state_width.cpp +++ b/synfig-studio/src/gui/states/state_width.cpp @@ -285,6 +285,7 @@ StateWidth_Context::StateWidth_Context(CanvasView* canvas_view): radius->set_radius(true); radius->set_type(Duck::TYPE_RADIUS); radius->set_name("radius"); + radius->set_point(Point(1.0,0.0)); } if(!closestpoint) @@ -296,7 +297,9 @@ StateWidth_Context::StateWidth_Context(CanvasView* canvas_view): //Disable duck clicking for the maximum coolness :) get_work_area()->set_allow_duck_clicks(false); - get_work_area()->set_type_mask((Duck::Type)((int)Duck::TYPE_WIDTH + (int)Duck::TYPE_RADIUS)); + // Hide all tangent, vertex and angle ducks and show the width and + // radius ducks + get_work_area()->set_type_mask((old_duckmask-Duck::TYPE_TANGENT-Duck::TYPE_VERTEX-Duck::TYPE_ANGLE) | Duck::TYPE_WIDTH | Duck::TYPE_RADIUS); // Turn the mouse pointer to crosshairs get_work_area()->set_cursor(Gdk::CROSSHAIR); @@ -536,6 +539,7 @@ StateWidth_Context::event_mouse_handler(const Smach::event& x) curve[1] = c->c1->get_trans_point(); curve[2] = c->c2->get_trans_point(); curve[3] = c->p2->get_trans_point(); + curve.sync(); p = curve(t); rsq = (p-event.pos).mag_squared(); @@ -544,7 +548,7 @@ StateWidth_Context::event_mouse_handler(const Smach::event& x) if(rsq < r) { - closestpoint->set_point(curve(t)); + closestpoint->set_point(p); //adjust the width... //squared falloff for radius... [0,1] @@ -554,6 +558,7 @@ StateWidth_Context::event_mouse_handler(const Smach::event& x) } } + //the points have been added added = true; ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Synfig-devl mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/synfig-devl
