Mercurial > projects > doodle
comparison doodle/dia/standard_tools.d @ 34:c2f11e1d7470
Geometry cleanup and checkpoint.
author | David Bryant <bagnose@gmail.com> |
---|---|
date | Sun, 30 Aug 2009 15:32:12 +0930 |
parents | 1754cb773d41 |
children | 188397ef9a12 |
comparison
equal
deleted
inserted
replaced
33:157b4ad5615d | 34:c2f11e1d7470 |
---|---|
103 } | 103 } |
104 | 104 |
105 override bool handle_button_release(scope Viewport viewport, in ButtonEvent event) { | 105 override bool handle_button_release(scope Viewport viewport, in ButtonEvent event) { |
106 if (event.button_name == ButtonName.LEFT && mActive) { | 106 if (event.button_name == ButtonName.LEFT && mActive) { |
107 mActive = false; | 107 mActive = false; |
108 viewport.damage_pixel(Rectangle(mAnchorPoint, mCurrentPoint).feathered(LINE_WIDTH / 2.0)); | 108 viewport.damage_pixel(feather(Rectangle(mAnchorPoint, mCurrentPoint), LINE_WIDTH / 2.0)); |
109 viewport.set_cursor(Cursor.DEFAULT); | 109 viewport.set_cursor(Cursor.DEFAULT); |
110 return true; | 110 return true; |
111 } | 111 } |
112 else { | 112 else { |
113 return false; | 113 return false; |
114 } | 114 } |
115 } | 115 } |
116 | 116 |
117 override bool handle_motion(scope Viewport viewport, in MotionEvent event) { | 117 override bool handle_motion(scope Viewport viewport, in MotionEvent event) { |
118 if (mActive) { | 118 if (mActive) { |
119 viewport.damage_pixel(Rectangle(mAnchorPoint, mCurrentPoint).feathered(LINE_WIDTH / 2.0)); | 119 viewport.damage_pixel(feather(Rectangle(mAnchorPoint, mCurrentPoint), LINE_WIDTH / 2.0)); |
120 mCurrentPoint = event.pixel_point; | 120 mCurrentPoint = event.pixel_point; |
121 viewport.damage_pixel(Rectangle(mAnchorPoint, mCurrentPoint).feathered(LINE_WIDTH / 2.0)); | 121 viewport.damage_pixel(feather(Rectangle(mAnchorPoint, mCurrentPoint), LINE_WIDTH / 2.0)); |
122 } | 122 } |
123 | 123 |
124 return false; | 124 return false; |
125 } | 125 } |
126 | 126 |