[Pharo-dev] [ bloc ] I do not understand why some behavior is not in the right place
siguctua at gmail.com
Mon Apr 4 17:45:26 EDT 2016
On 4 April 2016 at 23:17, stepharo <stepharo at free.fr> wrote:
> I have the impression that
> clipping and interaction can be defined by a "shape"
> then the drawing can be either drawn in a canvas or delegate to something
> else (for example for the cursor if there is an hardware rendering).
> I like this discussion and the feedback of igor because he is kicking our
> asses much better than me in fact
> because he has real argument while I just got feelings :)
> It is easy to kick asses.. much easier than doing things.
And please, explain to guys, that i am not some kind of trolly crazy angry
idiot, who sits in the corner making giggles and throwing paperballs into
student(s), because its fun.
It is because i also made similar mistakes, or have to fix other's mistakes
at own time, and really don't want people repeating them over and over
again, like ShadowCanvas, now its ShadowPaint.
> Le 4/4/16 19:10, Tudor Girba a écrit :
>> Indeed, this was not clear. The original idea of the shape was to be
>> primarily responsible for the clipping, but in the meantime the stroke and
>> fill filtered in the implementation. Alex, Andrei and I will now change the
>> “shape” to only be responsible for clipping and leave the drawing to the
>> element. We will also propose a solution for dealing with drawing and
>> Please stay tuned and thanks for this discussion.
>> On Apr 4, 2016, at 9:00 AM, stepharo <stepharo at free.fr> wrote:
>>> I saw in bleedingEdge it is different and looks better.
>>> Now I was wondering why shape did not do the rendering and I thought
>>> that this is may be because a shape can be used for doing something else
>>> than rendering. For example clipping or as igor mentioned defining the
>>> shape of the interaction
>>> drawOnSpartaCanvas: aCanvas
>>> "Actually render receiver on aCanvas in local bounds.
>>> Override to customize.
>>> aCanvas is an instance of AthensCanvas
>>> aCanvas must not be nil"
>>> self assert: self shape path context isNotNil.
>>> clipPreserveBy: self shape during: [
>>> aCanvas paintGroup: [
>>> aCanvas setPaint: self shape fillPaint.
>>> aCanvas fillPreserve.
>>> aCanvas paintMode source.
>>> aCanvas setStrokePaint: self shape strokePaint.
>>> aCanvas stroke ] ]
>>> unprotectedFullDrawOnSpartaCanvas: aCanvas
>>> "Draw the full structure on the given Canvas withing drawing bounds
>>> without caring about any errors and visibility. I am responsible for
>>> clipping and transforming canvas's path to local coordinates
>>> to allow simpler actual drawing in drawOnAthensCanvas:
>>> Additional checks should be implemented in fullDrawOnAthensCanvas:
>>> aCanvas is an instance of AthensCanvas.
>>> aCanvas must not be nil.
>>> @see BlElement>>#fullDrawOnAthensCanvas:
>>> @see BlElement>>#drawOnAthensCanvas:"
>>> self shape adaptTo: self.
>>> self shape path context: aCanvas.
>>> transform: self transformation
>>> during: [
>>> self clippingStrategy
>>> clip: self
>>> on: aCanvas
>>> during: [ self drawOnSpartaCanvas: aCanvas ]
>>> childrenDuring: [ self drawChildrenOnSpartaCanvas:
>>> aCanvas ] ]
>> "To utilize feedback, you first have to acquire it."
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev