diff options
author | Jonathan Duran | 2012-02-29 11:21:22 -0800 |
---|---|---|
committer | Jonathan Duran | 2012-02-29 11:21:22 -0800 |
commit | 31dc61a626ee9f2b08cb098a51ca0fed5bf30e77 (patch) | |
tree | 64e871bab274077f061168d1dca50055c0878881 /js/tools/PenTool.js | |
parent | 63740007b2fb4d8e71180bc3c7c8441929857b40 (diff) | |
download | ninja-31dc61a626ee9f2b08cb098a51ca0fed5bf30e77.tar.gz |
Squashed commit of the following:
commit 3dbe798285f95dc63ae33739df5daadb8c432f24
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 16:20:25 2012 -0800
putting the color panel on top when opening ninja
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
commit b5ae7f0babb185051242df47634e24ad7a68f60e
Merge: 20d4f1d 2bc8343
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 16:15:44 2012 -0800
Merge branch 'nested-selection' of https://github.com/mencio/ninja-internal into integration-candidate
Conflicts:
js/ninja.reel/ninja.html
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
commit 2bc834334a3197ab7cffacc7332eafd1b52443d1
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 16:11:42 2012 -0800
revert changes to the timeline
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
commit ae96ea66acc4be873fb7fb73fb3f4484b6db3eb8
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 16:03:32 2012 -0800
adding some margin to the bread crumb buttons
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
commit 20d4f1d703c004dd7f869576b6c471b3fb5b5d3e
Merge: ee52f19 557c4d3
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 16:02:37 2012 -0800
Merge pull request #81 from ananyasen/integration-candidate
persist selections while switching documents
commit 557c4d3100ccde51b925b71f0650b2c783a4a042
Author: Ananya Sen <Ananya.Sen@motorola.com>
Date: Tue Feb 28 16:02:15 2012 -0800
minor fix for handling selections on switch document
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
commit a230f0cd065613a1bc933e3d6d3f7e77f52bec04
Author: Ananya Sen <Ananya.Sen@motorola.com>
Date: Tue Feb 28 15:48:55 2012 -0800
selection controller sets _isDocument = true if number of selections are 0, on switch document
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
commit ee52f197d1eb53a5ff30b54b8df1d2b53014eb0e
Merge: 8e370cc da83f44
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 15:16:12 2012 -0800
Merge pull request #80 from joseeight/FileIO-Build-Candidate
Adding CSS <link> attributes support to I/O
commit 5ab7efb9949e486395659c383064a08821febdae
Author: Ananya Sen <Ananya.Sen@motorola.com>
Date: Tue Feb 28 15:15:27 2012 -0800
persist selections while switching documents
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
commit da83f44b0ecf379b0950a88d1c378fbedb80e386
Merge: b799b7c 676b4e2
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Tue Feb 28 15:15:12 2012 -0800
Merge branch 'refs/heads/integration-candidate' into FileIO-Build-Candidate
commit 8e370cc72aa85de594a5d55ae89947a70af414ca
Merge: 8de4002 676b4e2
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 15:08:48 2012 -0800
Merge branch 'integration-candidate' of github.com:Motorola-Mobility/ninja-internal into integration-candidate
commit 8de40029442333114d81ac30a8886a995a3dc56b
Merge: b0b4d64 eb27ed3
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 15:08:18 2012 -0800
Merge branch 'ToolFixes' of https://github.com/mqg734/ninja-internal into integration-candidate
commit eb27ed35bf282262843de13b00af89a2bceac53f
Merge: ea59626 7c9291a
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Tue Feb 28 15:04:33 2012 -0800
Merge branch 'refs/heads/ninja-internal' into ToolFixes
commit b799b7cf3a422f407045c52a4c6a61756d1ea096
Merge: f7c08fe 2ce9f65
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Tue Feb 28 15:03:38 2012 -0800
Merge branch 'refs/heads/FileIO' into FileIO-Build-Candidate
commit 2ce9f65c3a34937928f08690606962af3085c74f
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Tue Feb 28 15:03:23 2012 -0800
CSS attributes
Setting up logic to include attributes in <link> for the <style> duplicates and add attributes created in Ninja back to <link> tag on save.
commit ea5962641519b9d32499c4440112e7fa821e3a79
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Tue Feb 28 15:02:57 2012 -0800
Fix for "jumping" issue when using the selection tool repeatedly.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 676b4e2d7091ac63ce06f51be686b902b940bfff
Merge: b0b4d64 f2ab699
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 14:55:17 2012 -0800
Merge pull request #79 from pushkarjoshi/pentool
Pentool
commit f2ab6999a9fdaa18056fb5a148ef1bcaefb7d854
Author: Pushkar Joshi <pushkar@motorola.com>
Date: Tue Feb 28 14:53:33 2012 -0800
reverting manifest name
commit 63307c9abf120985d979a40a53a0598d3f0d5c5a
Merge: e1a65d0 7c9291a
Author: Pushkar Joshi <pushkar@motorola.com>
Date: Tue Feb 28 14:01:05 2012 -0800
Merge branch 'master' into pentool
Conflicts:
manifest.json
commit e1a65d0c2a13e12ee53be98c731616e35aa07a41
Author: Pushkar Joshi <pushkar@motorola.com>
Date: Tue Feb 28 13:58:34 2012 -0800
new anchor control guide rendering (smaller handles)
and
clamp min. width and height to 1 while resizing subpaths
commit b0b4d6492d6ddd3b7ab39c2f4d1c01b8e9bacfb6
Merge: 7cafa04 538db48
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 13:41:12 2012 -0800
Merge pull request #78 from imix23ways/Timeline
Timeline bug fixes
commit 933ed4c880128eed80bdc6372eb1dfdb23af4c37
Merge: 6af71de 7c9291a
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Tue Feb 28 13:33:45 2012 -0800
Merge branch 'refs/heads/NinjaInternal' into FileIO
commit f7c08fe5a8424d8c7837a4e3a975e63bcddc3b14
Merge: 811d509 7c9291a
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Tue Feb 28 13:33:17 2012 -0800
Merge branch 'refs/heads/NinjaInternal' into FileIO-Build-Candidate
commit 7cafa0464ee0c1621ffea04c2192f19008c9fc49
Merge: 2ab07cb 811d509
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 13:20:44 2012 -0800
Merge branch 'FileIO-Build-Candidate' of https://github.com/joseeight/ninja-internal into integration-candidate
commit 2ab07cb8ac76a06606ce455bb2e6b4889e3ddc65
Merge: e5b1102 347fc28
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 13:19:52 2012 -0800
Merge branch 'integration' of https://github.com/ericmueller/ninja-internal into integration-candidate
commit e5b1102f0cff7f5ba7074840ccf29dc1c02ced8e
Merge: 7c9291a a70c628
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 13:17:55 2012 -0800
Merge branch 'ToolFixes' of https://github.com/mqg734/ninja-internal into integration-candidate
commit 347fc28227d822e9fea3fa823fae79cf14ea041c
Merge: ed16298 7c9291a
Author: hwc487 <hwc487@motorola.com>
Date: Tue Feb 28 12:58:09 2012 -0800
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into integration
commit 7cbd26d475eaad817042692f9116f9a24ae60997
Author: Pushkar Joshi <pushkar@motorola.com>
Date: Tue Feb 28 10:24:06 2012 -0800
Bug fixes:
1152: allow deleting of multiple paths from inside pen tool
1128: keyboard hotkey shortcut 'P' for pen tool
941: changing width or height of the path scales the path
commit ed16298e4323b733f6dc957c307dc07036fa3569
Merge: b194efa 6054d13
Author: hwc487 <hwc487@motorola.com>
Date: Tue Feb 28 09:55:07 2012 -0800
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into integration
commit 19e94dc51a279501352a08d511b18144f83500e5
Author: Valerio Virgillito <valerio@motorola.com>
Date: Tue Feb 28 00:47:46 2012 -0800
cleanup and fixing selecting each bread crumb
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
commit 6af71de5b80fd531901e82b12372446b569902d8
Merge: f872077 6054d13
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Mon Feb 27 21:44:45 2012 -0800
Merge branch 'refs/heads/NinjaInternal' into FileIO
commit db5db0a92c1fb67eac262c33d4fbf776ceabbb3c
Author: Valerio Virgillito <valerio@motorola.com>
Date: Mon Feb 27 21:17:29 2012 -0800
breadcrumb cleanup and moving the resized on top of the timeline panel
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
commit a70c62891d0c7dd032d9382c50d1555ab81c4e33
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Mon Feb 27 16:24:13 2012 -0800
Fixing tooltips and keyboard shortcuts for 3d tools.
IKNinja-1014 and IKNinja-1015.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit ef38731ae2769dcb2247db599cdfe62d38e34b28
Author: Nivesh Rajbhandari <mqg734@motorola.com>
Date: Mon Feb 27 15:39:16 2012 -0800
Reset translation values as well when double-clicking to reset the rotation values.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
commit 811d5092345bf520f6a683eec89cf7d8ed7aa490
Merge: ceba159 f872077
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Mon Feb 27 14:39:10 2012 -0800
Merge branch 'refs/heads/FileIO' into FileIO-Build-Candidate
commit f872077e947916496235f4e871511ce890953d04
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Mon Feb 27 14:38:59 2012 -0800
Updating legal copy
commit ceba159acedcaada47f990392b3bbebc2025e40a
Merge: a564d96 3e2889b
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Mon Feb 27 14:29:53 2012 -0800
Merge branch 'refs/heads/FileIO' into FileIO-Build-Candidate
commit 3e2889b94d5e6af93ec0eaca114802e30c8c38ef
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Mon Feb 27 14:29:17 2012 -0800
Updating credits
commit affdf784f3dae1febe279a214857e6fe3ba56db1
Merge: 7e63b5d 15d00c4
Author: Jose Antonio Marquez Russo <jose@eightyearproject.com>
Date: Mon Feb 27 14:28:59 2012 -0800
Merge pull request #21 from ananyasen/FileIO
FileIO branch pull request
commit 15d00c49b522aa471d1ccfbbd33f5c0e721eb89e
Merge: 604ace9 7e63b5d
Author: Ananya Sen <Ananya.Sen@motorola.com>
Date: Mon Feb 27 14:24:49 2012 -0800
Merge branch 'refs/heads/FileIO-jose' into FileIO
commit a564d969ffcb7bc0dd701a1ef653f666ae857f77
Merge: c65eb4b 7e63b5d
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Mon Feb 27 14:11:09 2012 -0800
Merge branch 'refs/heads/FileIO' into FileIO-Build-Candidate
commit 7e63b5d0b6990b6c0ec0385d35534b91982ac672
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Mon Feb 27 14:10:53 2012 -0800
Cleaning up pretty functions in IO
commit b194efa0556806593b29eb197250df462e89fcc4
Author: hwc487 <hwc487@motorola.com>
Date: Mon Feb 27 14:03:11 2012 -0800
Enable shift key constraint for Pan Tool.
commit 124ad4709780013615d2ff1da05ace9887ee7709
Merge: a8bd158 8125c8c
Author: hwc487 <hwc487@motorola.com>
Date: Mon Feb 27 13:41:31 2012 -0800
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into integration
commit a8bd1585ae83d4d304b9f9f41823bb3dcbff9e01
Author: hwc487 <hwc487@motorola.com>
Date: Mon Feb 27 12:14:29 2012 -0800
Color fix for line shapes.
commit 604ace9cfc9fae6b6c121259523a9060c5306161
Author: Ananya Sen <Ananya.Sen@motorola.com>
Date: Mon Feb 27 11:59:58 2012 -0800
- save show3DGrid flag per document while switching documents
- fix zoom tool keyboard control to listen to Z when ctrl and shift keys are not pressed with it
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
commit bfa895634324a78652f2a7eecf725d9c6030023f
Author: hwc487 <hwc487@motorola.com>
Date: Mon Feb 27 11:58:44 2012 -0800
Changed the hardcoded publish setting for a PI fix.
commit 8578322c60adaaf65f37ba96f2a0f7ed9de8e1dc
Author: hwc487 <hwc487@motorola.com>
Date: Mon Feb 27 10:28:03 2012 -0800
Fixed various rendering bugs.
commit 544dec04fd379b10eff254bbdd105bfaf828f8a5
Author: Jose Antonio Marquez <kgq387@motorola.com>
Date: Sun Feb 26 12:12:22 2012 -0800
Cleaning up and adding TODOs
commit 053fc63a2950c7a5ee4ebf98033b64d474a3c46e
Merge: a5ba66e 23a2219
Author: Pushkar Joshi <pushkar@motorola.com>
Date: Fri Feb 24 12:03:51 2012 -0800
Merge branch 'master' into pentool
commit a5ba66ecefa9c9c17e0f5e1725e2141f7a3540a2
Author: Pushkar Joshi <pushkar@motorola.com>
Date: Fri Feb 24 12:01:03 2012 -0800
adding unpacked to the manifest file (to differentiate from the ninjateam (main) chrome app)
commit d0661d6c587aced68a68e36a5ec4e81f8a2096e8
Author: hwc487 <hwc487@motorola.com>
Date: Thu Feb 23 16:57:55 2012 -0800
bug fixes for canvas 2d shape drawing.
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/tools/PenTool.js')
-rwxr-xr-x | js/tools/PenTool.js | 160 |
1 files changed, 115 insertions, 45 deletions
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index 7749d525..ddc8bc04 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js | |||
@@ -66,14 +66,14 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
66 | _penPlaneMat: { value: null, writable: true }, | 66 | _penPlaneMat: { value: null, writable: true }, |
67 | 67 | ||
68 | //index of the anchor point that the user has hovered over | 68 | //index of the anchor point that the user has hovered over |
69 | _hoveredAnchorIndex: {value: null, writable: true}, | 69 | _hoveredAnchorIndex: {value: -1, writable: true}, |
70 | 70 | ||
71 | //constants used for picking points --- NOTE: these should be user-settable parameters | 71 | //constants used for picking points --- NOTE: these should be user-settable parameters |
72 | _PICK_POINT_RADIUS: { value: 10, writable: false }, | 72 | _PICK_POINT_RADIUS: { value: 10, writable: false }, |
73 | _DISPLAY_ANCHOR_RADIUS: { value: 5, writable: false }, | 73 | _DISPLAY_ANCHOR_RADIUS: { value: 5, writable: false }, |
74 | _DISPLAY_SELECTED_ANCHOR_RADIUS: { value: 10, writable: false }, | 74 | _DISPLAY_SELECTED_ANCHOR_RADIUS: { value: 10, writable: false }, |
75 | _DISPLAY_SELECTED_ANCHOR_PREV_RADIUS: { value: 5, writable: false }, | 75 | _DISPLAY_SELECTED_ANCHOR_PREV_RADIUS: { value: 2, writable: false }, |
76 | _DISPLAY_SELECTED_ANCHOR_NEXT_RADIUS: { value: 5, writable: false }, | 76 | _DISPLAY_SELECTED_ANCHOR_NEXT_RADIUS: { value: 2, writable: false }, |
77 | 77 | ||
78 | //constants used for editing modes (can be OR-ed) | 78 | //constants used for editing modes (can be OR-ed) |
79 | EDIT_NONE: { value: 0, writable: false }, | 79 | EDIT_NONE: { value: 0, writable: false }, |
@@ -760,9 +760,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
760 | var verticalOffset = this.application.ninja.stage.userContentTop; | 760 | var verticalOffset = this.application.ninja.stage.userContentTop; |
761 | //display the subpath as a sequence of cubic beziers | 761 | //display the subpath as a sequence of cubic beziers |
762 | ctx.lineWidth = 1;//TODO replace hardcoded stroke width with some programmatically set value (should not be same as stroke width) | 762 | ctx.lineWidth = 1;//TODO replace hardcoded stroke width with some programmatically set value (should not be same as stroke width) |
763 | if (ctx.lineWidth == subpath.getStrokeWidth()) | 763 | ctx.strokeStyle = "green"; |
764 | ctx.lineWidth = 3; | ||
765 | ctx.strokeStyle = "black"; | ||
766 | //if (subpath.getStrokeColor()) | 764 | //if (subpath.getStrokeColor()) |
767 | // ctx.strokeStyle = MathUtils.colorToHex( subpath.getStrokeColor() ); | 765 | // ctx.strokeStyle = MathUtils.colorToHex( subpath.getStrokeColor() ); |
768 | ctx.beginPath(); | 766 | ctx.beginPath(); |
@@ -812,34 +810,53 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
812 | var verticalOffset = this.application.ninja.stage.userContentTop;//stageManagerModule.stageManager.userContentTop; | 810 | var verticalOffset = this.application.ninja.stage.userContentTop;//stageManagerModule.stageManager.userContentTop; |
813 | 811 | ||
814 | //display circles and squares near all control points | 812 | //display circles and squares near all control points |
815 | ctx.fillStyle = "#FF4444"; | 813 | ctx.fillStyle = "#FFFFFF"; |
816 | ctx.lineWidth = 2; | 814 | ctx.lineWidth = 1; |
817 | ctx.strokeStyle = "black"; | 815 | ctx.strokeStyle = "green"; |
816 | var anchorDelta = 2; | ||
817 | var selAnchorDelta = 4; | ||
818 | |||
818 | for (var i = 0; i < numAnchors; i++) { | 819 | for (var i = 0; i < numAnchors; i++) { |
819 | var px = subpath.getAnchor(i).getPosX(); | 820 | var px = subpath.getAnchor(i).getPosX(); |
820 | var py = subpath.getAnchor(i).getPosY(); | 821 | var py = subpath.getAnchor(i).getPosY(); |
821 | ctx.beginPath(); | 822 | ctx.beginPath(); |
822 | ctx.arc(px + horizontalOffset, py + verticalOffset, this._DISPLAY_ANCHOR_RADIUS, 0, 2 * Math.PI, false); | 823 | //ctx.arc(px + horizontalOffset, py + verticalOffset, this._DISPLAY_ANCHOR_RADIUS, 0, 2 * Math.PI, false); |
824 | ctx.moveTo(px-anchorDelta+horizontalOffset, py-anchorDelta+verticalOffset); | ||
825 | ctx.lineTo(px+anchorDelta+horizontalOffset, py-anchorDelta+verticalOffset); | ||
826 | ctx.lineTo(px+anchorDelta+horizontalOffset, py+anchorDelta+verticalOffset); | ||
827 | ctx.lineTo(px-anchorDelta+horizontalOffset, py+anchorDelta+verticalOffset); | ||
828 | ctx.closePath(); | ||
823 | ctx.fill(); | 829 | ctx.fill(); |
824 | ctx.stroke(); | 830 | ctx.stroke(); |
825 | } | 831 | } |
826 | 832 | ||
827 | //display the hovered over anchor point | 833 | //display the hovered over anchor point |
828 | ctx.lineWidth = 2; | 834 | ctx.lineWidth = 2; |
829 | ctx.strokeStyle = "black"; | 835 | if (this._hoveredAnchorIndex>=0 && this._hoveredAnchorIndex<numAnchors) { |
830 | if (this._hoveredAnchorIndex && this._hoveredAnchorIndex>=0 && this._hoveredAnchorIndex<numAnchors) { | ||
831 | var px = subpath.getAnchor(this._hoveredAnchorIndex).getPosX(); | 836 | var px = subpath.getAnchor(this._hoveredAnchorIndex).getPosX(); |
832 | var py = subpath.getAnchor(this._hoveredAnchorIndex).getPosY(); | 837 | var py = subpath.getAnchor(this._hoveredAnchorIndex).getPosY(); |
833 | ctx.beginPath(); | 838 | ctx.beginPath(); |
834 | ctx.arc(px + horizontalOffset, py + verticalOffset, this._DISPLAY_ANCHOR_RADIUS*1.5, 0, 2 * Math.PI, false); | 839 | //ctx.arc(px + horizontalOffset, py + verticalOffset, this._DISPLAY_ANCHOR_RADIUS*1.5, 0, 2 * Math.PI, false); |
840 | ctx.moveTo(px-selAnchorDelta+horizontalOffset, py-selAnchorDelta+verticalOffset); | ||
841 | ctx.lineTo(px+selAnchorDelta+horizontalOffset, py-selAnchorDelta+verticalOffset); | ||
842 | ctx.lineTo(px+selAnchorDelta+horizontalOffset, py+selAnchorDelta+verticalOffset); | ||
843 | ctx.lineTo(px-selAnchorDelta+horizontalOffset, py+selAnchorDelta+verticalOffset); | ||
844 | ctx.closePath(); | ||
835 | ctx.stroke(); | 845 | ctx.stroke(); |
836 | } | 846 | } |
837 | 847 | ||
848 | |||
838 | //display selected anchor and its prev. and next points | 849 | //display selected anchor and its prev. and next points |
839 | if (this._selectedSubpath && subpath === this._selectedSubpath && this._selectedSubpath.getSelectedAnchorIndex()!== -1) { | 850 | if (this._selectedSubpath && subpath === this._selectedSubpath && this._selectedSubpath.getSelectedAnchorIndex()!== -1) { |
840 | ctx.lineWidth = 2; | 851 | ctx.lineWidth = 1; |
841 | ctx.strokeStyle = "black"; | 852 | var defFill = "#FFFFFF"; |
853 | var defStroke = "green"; | ||
854 | var selHandleFill = "#000000" | ||
855 | |||
856 | ctx.strokeStyle = defStroke; | ||
857 | ctx.fillStyle = defFill; | ||
842 | var selAnchor = this._selectedSubpath.getAnchor(this._selectedSubpath.getSelectedAnchorIndex()); | 858 | var selAnchor = this._selectedSubpath.getAnchor(this._selectedSubpath.getSelectedAnchorIndex()); |
859 | var whichPoint = this._selectedSubpath.getSelectedMode(); //which of the selected handles to highlight | ||
843 | 860 | ||
844 | //line from prev to anchor | 861 | //line from prev to anchor |
845 | ctx.beginPath(); | 862 | ctx.beginPath(); |
@@ -848,10 +865,16 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
848 | ctx.stroke(); | 865 | ctx.stroke(); |
849 | 866 | ||
850 | //selected anchor prev | 867 | //selected anchor prev |
851 | ctx.fillStyle = "#AAAAAA"; | ||
852 | ctx.beginPath(); | 868 | ctx.beginPath(); |
853 | ctx.arc(selAnchor.getPrevX() + horizontalOffset, selAnchor.getPrevY() + verticalOffset, this._DISPLAY_SELECTED_ANCHOR_PREV_RADIUS, 0, 2 * Math.PI, false); | 869 | ctx.arc(selAnchor.getPrevX() + horizontalOffset, selAnchor.getPrevY() + verticalOffset, this._DISPLAY_SELECTED_ANCHOR_PREV_RADIUS, 0, 2 * Math.PI, false); |
854 | ctx.fill(); | 870 | ctx.closePath(); |
871 | if (whichPoint & this._selectedSubpath.SEL_PREV){ | ||
872 | ctx.fillStyle = selHandleFill; | ||
873 | ctx.fill(); | ||
874 | ctx.fillStyle = defFill; | ||
875 | }else { | ||
876 | ctx.fill(); | ||
877 | } | ||
855 | ctx.stroke(); | 878 | ctx.stroke(); |
856 | 879 | ||
857 | //line from next to anchor | 880 | //line from next to anchor |
@@ -861,16 +884,27 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
861 | ctx.stroke(); | 884 | ctx.stroke(); |
862 | 885 | ||
863 | //selected anchor next | 886 | //selected anchor next |
864 | ctx.fillStyle = "#666666"; | ||
865 | ctx.beginPath(); | 887 | ctx.beginPath(); |
866 | ctx.arc(selAnchor.getNextX() + horizontalOffset, selAnchor.getNextY() + verticalOffset, this._DISPLAY_SELECTED_ANCHOR_NEXT_RADIUS, 0, 2 * Math.PI, false); | 888 | ctx.arc(selAnchor.getNextX() + horizontalOffset, selAnchor.getNextY() + verticalOffset, this._DISPLAY_SELECTED_ANCHOR_NEXT_RADIUS, 0, 2 * Math.PI, false); |
867 | ctx.fill(); | 889 | if (whichPoint & this._selectedSubpath.SEL_NEXT){ |
890 | ctx.fillStyle = selHandleFill; | ||
891 | ctx.fill(); | ||
892 | ctx.fillStyle = defFill; | ||
893 | }else { | ||
894 | ctx.fill(); | ||
895 | } | ||
868 | ctx.stroke(); | 896 | ctx.stroke(); |
869 | 897 | ||
870 | //selected anchor point | 898 | //selected anchor point |
871 | ctx.fillStyle = "#8ED6FF"; | 899 | var px = selAnchor.getPosX(); |
900 | var py = selAnchor.getPosY(); | ||
872 | ctx.beginPath(); | 901 | ctx.beginPath(); |
873 | ctx.arc(selAnchor.getPosX() + horizontalOffset, selAnchor.getPosY() + verticalOffset, this._DISPLAY_SELECTED_ANCHOR_RADIUS, 0, 2 * Math.PI, false); | 902 | //ctx.arc(selAnchor.getPosX() + horizontalOffset, selAnchor.getPosY() + verticalOffset, this._DISPLAY_SELECTED_ANCHOR_RADIUS, 0, 2 * Math.PI, false); |
903 | ctx.moveTo(px-selAnchorDelta+horizontalOffset, py-selAnchorDelta+verticalOffset); | ||
904 | ctx.lineTo(px+selAnchorDelta+horizontalOffset, py-selAnchorDelta+verticalOffset); | ||
905 | ctx.lineTo(px+selAnchorDelta+horizontalOffset, py+selAnchorDelta+verticalOffset); | ||
906 | ctx.lineTo(px-selAnchorDelta+horizontalOffset, py+selAnchorDelta+verticalOffset); | ||
907 | ctx.closePath(); | ||
874 | ctx.fill(); | 908 | ctx.fill(); |
875 | ctx.stroke(); | 909 | ctx.stroke(); |
876 | 910 | ||
@@ -879,7 +913,12 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
879 | ctx.lineWidth = 2; | 913 | ctx.lineWidth = 2; |
880 | ctx.strokeStyle = "red"; | 914 | ctx.strokeStyle = "red"; |
881 | ctx.beginPath(); | 915 | ctx.beginPath(); |
882 | ctx.arc(this._snapTarget.getPosX() + horizontalOffset, this._snapTarget.getPosY() + verticalOffset, this._DISPLAY_SELECTED_ANCHOR_RADIUS * 2, 0, 2 * Math.PI, false); | 916 | //ctx.arc(this._snapTarget.getPosX() + horizontalOffset, this._snapTarget.getPosY() + verticalOffset, this._DISPLAY_SELECTED_ANCHOR_RADIUS * 2, 0, 2 * Math.PI, false); |