Canvas >>draw: anObject

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Canvas >>draw: anObject

Stéphane Ducasse
Canvas>>draw: anObject
        ^anObject drawOn: self


Now in SM we got

SMxCanvas>>draw: anObject
        ^self clipBy: anObject bounds during: [ :c | anObject drawOn: c]

and I'm wondering what is the exact difference.
Any idea?

Stef

Reply | Threaded
Open this post in threaded view
|

Re: Canvas >>draw: anObject

Igor Stasenko
On 7 February 2011 22:41, Stéphane Ducasse <[hidden email]> wrote:

> Canvas>>draw: anObject
>        ^anObject drawOn: self
>
>
> Now in SM we got
>
> SMxCanvas>>draw: anObject
>        ^self clipBy: anObject bounds during: [ :c | anObject drawOn: c]
>
> and I'm wondering what is the exact difference.
> Any idea?
>

yes,
SMxCanvas ensures that not matter what happens, a morph cannot draw
outside of its declared bounds.
Which usually should not happen anyways.. so it looks like an
additional rule enforcement.



> Stef
>


--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Canvas >>draw: anObject

Stéphane Ducasse
Yes now apparently even if I draw outside the bounds they are clipped in pharo too. I have to check how.

On Feb 8, 2011, at 12:51 AM, Igor Stasenko wrote:

> On 7 February 2011 22:41, Stéphane Ducasse <[hidden email]> wrote:
>> Canvas>>draw: anObject
>>       ^anObject drawOn: self
>>
>>
>> Now in SM we got
>>
>> SMxCanvas>>draw: anObject
>>       ^self clipBy: anObject bounds during: [ :c | anObject drawOn: c]
>>
>> and I'm wondering what is the exact difference.
>> Any idea?
>>
>
> yes,
> SMxCanvas ensures that not matter what happens, a morph cannot draw
> outside of its declared bounds.
> Which usually should not happen anyways.. so it looks like an
> additional rule enforcement.
>
>
>
>> Stef
>>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>



Reply | Threaded
Open this post in threaded view
|

Re: Canvas >>draw: anObject

Fernando olivero-2
There's a method in Morph>>clipsSubmorphs , that dictates that behavior.
surely is on by default .

Fernando


On Tue, Feb 8, 2011 at 10:20 AM, Stéphane Ducasse
<[hidden email]> wrote:

> Yes now apparently even if I draw outside the bounds they are clipped in pharo too. I have to check how.
>
> On Feb 8, 2011, at 12:51 AM, Igor Stasenko wrote:
>
>> On 7 February 2011 22:41, Stéphane Ducasse <[hidden email]> wrote:
>>> Canvas>>draw: anObject
>>>       ^anObject drawOn: self
>>>
>>>
>>> Now in SM we got
>>>
>>> SMxCanvas>>draw: anObject
>>>       ^self clipBy: anObject bounds during: [ :c | anObject drawOn: c]
>>>
>>> and I'm wondering what is the exact difference.
>>> Any idea?
>>>
>>
>> yes,
>> SMxCanvas ensures that not matter what happens, a morph cannot draw
>> outside of its declared bounds.
>> Which usually should not happen anyways.. so it looks like an
>> additional rule enforcement.
>>
>>
>>
>>> Stef
>>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Canvas >>draw: anObject

Igor Stasenko
On 8 February 2011 16:37, Fernando Olivero <[hidden email]> wrote:
> There's a method in Morph>>clipsSubmorphs , that dictates that behavior.
> surely is on by default .
>

no. this is different.
It tells whether submorphs can be drawn outside of morph's bounds, but
nothing about morph itself.

In fact, i think many of these flags are redundant. For instance: if
one wants submorphs to be drawn outside of morph's bounds,
he can simply put them into morph's parent and so on up to topmost one
- world..


> Fernando
>
>
> On Tue, Feb 8, 2011 at 10:20 AM, Stéphane Ducasse
> <[hidden email]> wrote:
>> Yes now apparently even if I draw outside the bounds they are clipped in pharo too. I have to check how.
>>
>> On Feb 8, 2011, at 12:51 AM, Igor Stasenko wrote:
>>
>>> On 7 February 2011 22:41, Stéphane Ducasse <[hidden email]> wrote:
>>>> Canvas>>draw: anObject
>>>>       ^anObject drawOn: self
>>>>
>>>>
>>>> Now in SM we got
>>>>
>>>> SMxCanvas>>draw: anObject
>>>>       ^self clipBy: anObject bounds during: [ :c | anObject drawOn: c]
>>>>
>>>> and I'm wondering what is the exact difference.
>>>> Any idea?
>>>>
>>>
>>> yes,
>>> SMxCanvas ensures that not matter what happens, a morph cannot draw
>>> outside of its declared bounds.
>>> Which usually should not happen anyways.. so it looks like an
>>> additional rule enforcement.
>>>
>>>
>>>
>>>> Stef
>>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko AKA sig.
>>>
>>
>>
>>
>>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Canvas >>draw: anObject

Gary Chambers-4
It is all rather messy.
Note that #fullBounds can be different to #bounds if submorphs lie outside
the bounds of the owner (parent).

Regards, Gary

----- Original Message -----
From: "Igor Stasenko" <[hidden email]>
To: <[hidden email]>; <[hidden email]>
Sent: Tuesday, February 08, 2011 3:42 PM
Subject: Re: [Pharo-project] Canvas >>draw: anObject


On 8 February 2011 16:37, Fernando Olivero <[hidden email]> wrote:
> There's a method in Morph>>clipsSubmorphs , that dictates that behavior.
> surely is on by default .
>

no. this is different.
It tells whether submorphs can be drawn outside of morph's bounds, but
nothing about morph itself.

In fact, i think many of these flags are redundant. For instance: if
one wants submorphs to be drawn outside of morph's bounds,
he can simply put them into morph's parent and so on up to topmost one
- world..


> Fernando
>
>
> On Tue, Feb 8, 2011 at 10:20 AM, Stéphane Ducasse
> <[hidden email]> wrote:
>> Yes now apparently even if I draw outside the bounds they are clipped in
>> pharo too. I have to check how.
>>
>> On Feb 8, 2011, at 12:51 AM, Igor Stasenko wrote:
>>
>>> On 7 February 2011 22:41, Stéphane Ducasse <[hidden email]>
>>> wrote:
>>>> Canvas>>draw: anObject
>>>> ^anObject drawOn: self
>>>>
>>>>
>>>> Now in SM we got
>>>>
>>>> SMxCanvas>>draw: anObject
>>>> ^self clipBy: anObject bounds during: [ :c | anObject drawOn: c]
>>>>
>>>> and I'm wondering what is the exact difference.
>>>> Any idea?
>>>>
>>>
>>> yes,
>>> SMxCanvas ensures that not matter what happens, a morph cannot draw
>>> outside of its declared bounds.
>>> Which usually should not happen anyways.. so it looks like an
>>> additional rule enforcement.
>>>
>>>
>>>
>>>> Stef
>>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko AKA sig.
>>>
>>
>>
>>
>>
>
>



--
Best regards,
Igor Stasenko AKA sig.


Reply | Threaded
Open this post in threaded view
|

Re: Canvas >>draw: anObject

Igor Stasenko
On 8 February 2011 16:54, Gary Chambers <[hidden email]> wrote:
> It is all rather messy.
> Note that #fullBounds can be different to #bounds if submorphs lie outside
> the bounds of the owner (parent).
>
yeah, which again could be made a simpler life for everything by
placing morph one level higher,
to prevent submorphs to be outside of parent.

> Regards, Gary
>
> ----- Original Message ----- From: "Igor Stasenko" <[hidden email]>
> To: <[hidden email]>; <[hidden email]>
> Sent: Tuesday, February 08, 2011 3:42 PM
> Subject: Re: [Pharo-project] Canvas >>draw: anObject
>
>
> On 8 February 2011 16:37, Fernando Olivero <[hidden email]> wrote:
>>
>> There's a method in Morph>>clipsSubmorphs , that dictates that behavior.
>> surely is on by default .
>>
>
> no. this is different.
> It tells whether submorphs can be drawn outside of morph's bounds, but
> nothing about morph itself.
>
> In fact, i think many of these flags are redundant. For instance: if
> one wants submorphs to be drawn outside of morph's bounds,
> he can simply put them into morph's parent and so on up to topmost one
> - world..
>
>
>> Fernando
>>
>>
>> On Tue, Feb 8, 2011 at 10:20 AM, Stéphane Ducasse
>> <[hidden email]> wrote:
>>>
>>> Yes now apparently even if I draw outside the bounds they are clipped in
>>> pharo too. I have to check how.
>>>
>>> On Feb 8, 2011, at 12:51 AM, Igor Stasenko wrote:
>>>
>>>> On 7 February 2011 22:41, Stéphane Ducasse <[hidden email]>
>>>> wrote:
>>>>>
>>>>> Canvas>>draw: anObject
>>>>> ^anObject drawOn: self
>>>>>
>>>>>
>>>>> Now in SM we got
>>>>>
>>>>> SMxCanvas>>draw: anObject
>>>>> ^self clipBy: anObject bounds during: [ :c | anObject drawOn: c]
>>>>>
>>>>> and I'm wondering what is the exact difference.
>>>>> Any idea?
>>>>>
>>>>
>>>> yes,
>>>> SMxCanvas ensures that not matter what happens, a morph cannot draw
>>>> outside of its declared bounds.
>>>> Which usually should not happen anyways.. so it looks like an
>>>> additional rule enforcement.
>>>>
>>>>
>>>>
>>>>> Stef
>>>>>
>>>>
>>>>
>>>> --
>>>> Best regards,
>>>> Igor Stasenko AKA sig.
>>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Canvas >>draw: anObject

Gary Chambers-4
That would be nicer/more-understandable (and more like virtually every other
ui!).
There are a few cases that rely on it, however. Possibly not used/important
though, or
even working now (flop out scrollbars anyone?).

Regards, Gary

----- Original Message -----
From: "Igor Stasenko" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, February 08, 2011 4:28 PM
Subject: Re: [Pharo-project] Canvas >>draw: anObject


On 8 February 2011 16:54, Gary Chambers <[hidden email]> wrote:
> It is all rather messy.
> Note that #fullBounds can be different to #bounds if submorphs lie outside
> the bounds of the owner (parent).
>
yeah, which again could be made a simpler life for everything by
placing morph one level higher,
to prevent submorphs to be outside of parent.

> Regards, Gary
>
> ----- Original Message ----- From: "Igor Stasenko" <[hidden email]>
> To: <[hidden email]>; <[hidden email]>
> Sent: Tuesday, February 08, 2011 3:42 PM
> Subject: Re: [Pharo-project] Canvas >>draw: anObject
>
>
> On 8 February 2011 16:37, Fernando Olivero <[hidden email]>
> wrote:
>>
>> There's a method in Morph>>clipsSubmorphs , that dictates that behavior.
>> surely is on by default .
>>
>
> no. this is different.
> It tells whether submorphs can be drawn outside of morph's bounds, but
> nothing about morph itself.
>
> In fact, i think many of these flags are redundant. For instance: if
> one wants submorphs to be drawn outside of morph's bounds,
> he can simply put them into morph's parent and so on up to topmost one
> - world..
>
>
>> Fernando
>>
>>
>> On Tue, Feb 8, 2011 at 10:20 AM, Stéphane Ducasse
>> <[hidden email]> wrote:
>>>
>>> Yes now apparently even if I draw outside the bounds they are clipped in
>>> pharo too. I have to check how.
>>>
>>> On Feb 8, 2011, at 12:51 AM, Igor Stasenko wrote:
>>>
>>>> On 7 February 2011 22:41, Stéphane Ducasse <[hidden email]>
>>>> wrote:
>>>>>
>>>>> Canvas>>draw: anObject
>>>>> ^anObject drawOn: self
>>>>>
>>>>>
>>>>> Now in SM we got
>>>>>
>>>>> SMxCanvas>>draw: anObject
>>>>> ^self clipBy: anObject bounds during: [ :c | anObject drawOn: c]
>>>>>
>>>>> and I'm wondering what is the exact difference.
>>>>> Any idea?
>>>>>
>>>>
>>>> yes,
>>>> SMxCanvas ensures that not matter what happens, a morph cannot draw
>>>> outside of its declared bounds.
>>>> Which usually should not happen anyways.. so it looks like an
>>>> additional rule enforcement.
>>>>
>>>>
>>>>
>>>>> Stef
>>>>>
>>>>
>>>>
>>>> --
>>>> Best regards,
>>>> Igor Stasenko AKA sig.
>>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>
>



--
Best regards,
Igor Stasenko AKA sig.


Reply | Threaded
Open this post in threaded view
|

Re: Canvas >>draw: anObject

Stéphane Ducasse
In reply to this post by Gary Chambers-4
So it would be good to slowly start cleaning.
I will go over SM and make a long list of notes and clean SMs/Morphic when doing that.

Stef

> It is all rather messy.
> Note that #fullBounds can be different to #bounds if submorphs lie outside the bounds of the owner (parent).
>
> Regards, Gary
>
> ----- Original Message ----- From: "Igor Stasenko" <[hidden email]>
> To: <[hidden email]>; <[hidden email]>
> Sent: Tuesday, February 08, 2011 3:42 PM
> Subject: Re: [Pharo-project] Canvas >>draw: anObject
>
>
> On 8 February 2011 16:37, Fernando Olivero <[hidden email]> wrote:
>> There's a method in Morph>>clipsSubmorphs , that dictates that behavior.
>> surely is on by default .
>>
>
> no. this is different.
> It tells whether submorphs can be drawn outside of morph's bounds, but
> nothing about morph itself.
>
> In fact, i think many of these flags are redundant. For instance: if
> one wants submorphs to be drawn outside of morph's bounds,
> he can simply put them into morph's parent and so on up to topmost one
> - world..
>
>
>> Fernando
>>
>>
>> On Tue, Feb 8, 2011 at 10:20 AM, Stéphane Ducasse
>> <[hidden email]> wrote:
>>> Yes now apparently even if I draw outside the bounds they are clipped in pharo too. I have to check how.
>>>
>>> On Feb 8, 2011, at 12:51 AM, Igor Stasenko wrote:
>>>
>>>> On 7 February 2011 22:41, Stéphane Ducasse <[hidden email]> wrote:
>>>>> Canvas>>draw: anObject
>>>>> ^anObject drawOn: self
>>>>>
>>>>>
>>>>> Now in SM we got
>>>>>
>>>>> SMxCanvas>>draw: anObject
>>>>> ^self clipBy: anObject bounds during: [ :c | anObject drawOn: c]
>>>>>
>>>>> and I'm wondering what is the exact difference.
>>>>> Any idea?
>>>>>
>>>>
>>>> yes,
>>>> SMxCanvas ensures that not matter what happens, a morph cannot draw
>>>> outside of its declared bounds.
>>>> Which usually should not happen anyways.. so it looks like an
>>>> additional rule enforcement.
>>>>
>>>>
>>>>
>>>>> Stef
>>>>>
>>>>
>>>>
>>>> --
>>>> Best regards,
>>>> Igor Stasenko AKA sig.
>>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Canvas >>draw: anObject

Stéphane Ducasse
In reply to this post by Fernando olivero-2
not in morph strange.

On Feb 8, 2011, at 4:37 PM, Fernando Olivero wrote:

> There's a method in Morph>>clipsSubmorphs , that dictates that behavior.
> surely is on by default .
>
> Fernando
>
>
> On Tue, Feb 8, 2011 at 10:20 AM, Stéphane Ducasse
> <[hidden email]> wrote:
>> Yes now apparently even if I draw outside the bounds they are clipped in pharo too. I have to check how.
>>
>> On Feb 8, 2011, at 12:51 AM, Igor Stasenko wrote:
>>
>>> On 7 February 2011 22:41, Stéphane Ducasse <[hidden email]> wrote:
>>>> Canvas>>draw: anObject
>>>>       ^anObject drawOn: self
>>>>
>>>>
>>>> Now in SM we got
>>>>
>>>> SMxCanvas>>draw: anObject
>>>>       ^self clipBy: anObject bounds during: [ :c | anObject drawOn: c]
>>>>
>>>> and I'm wondering what is the exact difference.
>>>> Any idea?
>>>>
>>>
>>> yes,
>>> SMxCanvas ensures that not matter what happens, a morph cannot draw
>>> outside of its declared bounds.
>>> Which usually should not happen anyways.. so it looks like an
>>> additional rule enforcement.
>>>
>>>
>>>
>>>> Stef
>>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko AKA sig.
>>>
>>
>>
>>
>>
>