[Cuis-dev] VectorGraphics and Morph
Juan Vuletich
juan at jvuletich.org
Wed Jul 8 06:42:32 PDT 2020
On 7/4/2020 5:46 PM, Hilaire Fernandes via Cuis-dev wrote:
> containsPoint: aPoint
> (super containsPoint: aPoint) ifFalse: [^ false].
>
> (closed and: [color isTransparent not]) ifTrue:
> [ ^ (self filledForm pixelValueAt: aPoint - bounds topLeft + 1)> 0].
>
> self lineSegmentsDo:
> [ :p1 :p2 |
> (aPoint onLineFrom: p1 to: p2 within: (3 max: borderWidth+1//2) asFloat)
> ifTrue: [^ true]].
>
> self arrowForms do:
> [ :f | (f pixelValueAt: aPoint - f offset)> 0 ifTrue: [^ true]].
>
> ^ false
Hi Hilaire,
The first thing to mention is that PolygonMorph should not inherit from
RectangleLikeMorph. PolygonMorph is more like M3Exp01Morph, M3Exp02Morph
and M3Exp03Morph. But these also don't work well yet. Damage areas are
not reported correctly and morphContainsPoint: doesn't work either.
The VectorGraphicsPasteUpMorph was just a hack to let you play with
vector graphics drawing, but I guess it is time to clean it up, make it
usable, and integrate it. Then it will make sense to start building
things like PolygonMorph in a clean style.
Please give me a few days to work on this.
Cheers,
--
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200708/1f59ef5a/attachment.htm>
More information about the Cuis-dev
mailing list