--- a/Arrow.st Mon Mar 14 10:57:27 2011 +0100
+++ b/Arrow.st Mon Mar 14 11:43:41 2011 +0100
@@ -258,7 +258,7 @@
!
arrowPointsFor:sP and:eP position:arrowHeadPosition offset:arrowHeadOffset length:arrowHeadLength angle:arrowHeadAngle
- "return the arrowPoints for an arrow from sP to eP in a collection"
+ "return the arrowPoints for an arrow from sP to eP as a collection of points (for a polygon-fill)"
|arrowHeadPoint len pos angle grad x1 y1 x2 y2
atn p1 p2 deriv dX dY|
@@ -273,10 +273,20 @@
arrowHeadOffset notNil ifTrue:[
(eP x = sP x) ifTrue:[
"/ vertical
- arrowHeadPoint := arrowHeadPoint + (0 @ arrowHeadOffset)
+ (eP y > sP y) ifTrue:[
+ arrowHeadPoint := arrowHeadPoint + (0 @ arrowHeadOffset)
+ ] ifFalse:[
+ arrowHeadPoint := arrowHeadPoint - (0 @ arrowHeadOffset)
+ ].
] ifFalse:[
- "/ horizontal
- arrowHeadPoint := arrowHeadPoint + (arrowHeadOffset @ 0)
+ (eP y = sP y) ifTrue:[
+ "/ horizontal
+ (eP x > sP x) ifTrue:[
+ arrowHeadPoint := arrowHeadPoint + (arrowHeadOffset @ 0)
+ ] ifFalse:[
+ arrowHeadPoint := arrowHeadPoint - (arrowHeadOffset @ 0)
+ ].
+ ].
].
].
@@ -560,11 +570,11 @@
!Arrow class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Arrow.st,v 1.27 2011-03-14 09:57:27 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Arrow.st,v 1.28 2011-03-14 10:43:41 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic2/Arrow.st,v 1.27 2011-03-14 09:57:27 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Arrow.st,v 1.28 2011-03-14 10:43:41 cg Exp $'
! !
Arrow initialize!