The Trunk: Graphics-topa.301.mcz

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

The Trunk: Graphics-topa.301.mcz

commits-2
Tobias Pape uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-topa.301.mcz

==================== Summary ====================

Name: Graphics-topa.301
Author: topa
Time: 16 September 2014, 5:16:44.215 pm
UUID: a66aac86-031b-4db4-97ce-e33376745f9e
Ancestors: Graphics-mt.300

Fix Mantis 5711
        http://bugs.squeak.org/view.php?id=5711
after 7 years...

=============== Diff against Graphics-mt.300 ===============

Item was changed:
  ----- Method: TextComposer>>composeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks: (in category 'as yet unclassified') -----
  composeLinesFrom: argStart to: argStop delta: argDelta into: argLinesCollection priorLines: argPriorLines atY: argStartY textStyle: argTextStyle text: argText container: argContainer wantsColumnBreaks: argWantsColumnBreaks
 
  wantsColumnBreaks := argWantsColumnBreaks.
  lines := argLinesCollection.
  theTextStyle := argTextStyle.
  theText := argText.
  theContainer := argContainer.
  deltaCharIndex := argDelta.
  currCharIndex := startCharIndex := argStart.
  stopCharIndex := argStop.
  prevLines := argPriorLines.
  currentY := argStartY.
  maxRightX := theContainer left.
  possibleSlide := stopCharIndex < theText size and: [theContainer isMemberOf: Rectangle].
  nowSliding := false.
  prevIndex := 1.
  "choose an appropriate scanner - should go away soon, when they can be unified"
  scanner := CompositionScanner new.
  scanner text: theText textStyle: theTextStyle.
  scanner wantsColumnBreaks: wantsColumnBreaks.
  defaultLineHeight := scanner computeDefaultLineHeight.
  isFirstLine := true.
  self composeAllLines.
  isFirstLine ifTrue: ["No space in container or empty text"
  self
  addNullLineWithIndex: startCharIndex
+ andRectangle: (theContainer left @ theContainer top extent: 0@defaultLineHeight)
- andRectangle: (theContainer topLeft extent: 0@defaultLineHeight)
  ] ifFalse: [
  (lines last last = theText size and: [scanner doesTheLineBreaksAfterLastChar])
  ifTrue: [self addNullLineForIndex: theText size + 1]
  ].
  ^{lines asArray. maxRightX}
  !


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-topa.301.mcz

Frank Shearar-3
On 16 September 2014 16:16,  <[hidden email]> wrote:

> Tobias Pape uploaded a new version of Graphics to project The Trunk:
> http://source.squeak.org/trunk/Graphics-topa.301.mcz
>
> ==================== Summary ====================
>
> Name: Graphics-topa.301
> Author: topa
> Time: 16 September 2014, 5:16:44.215 pm
> UUID: a66aac86-031b-4db4-97ce-e33376745f9e
> Ancestors: Graphics-mt.300
>
> Fix Mantis 5711
>         http://bugs.squeak.org/view.php?id=5711
> after 7 years...
>
> =============== Diff against Graphics-mt.300 ===============

Don't forget to tell Mantis that :)

frank

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-topa.301.mcz

Nicolas Cellier
Nice catch indeed.
But, ouch!
    (self left @ self top) ~= self topLeft...
Without looking at the code, it sounds like heresy!
Wouldn't the real fix be to name a cat a cat? (a corner a corner in this case).

After a brief look at the code, of course things are not so simple.
I'm not sure I completely understand the contracts, but inside the owner rectangular area, there are only some portions available for displaying text, and top answers the topMostAvailableDisplayArea...
This fake insulate some users of top from the knowledge of this availableAreaForDisplay feature which sounds like a good thing...
But in the same time, it fakes the innocent users of topLeft expecting top+left=topLeft.
No matter the di initials (sorry to scratch an icon), but IMO it's a well too sophisticated hack, and such hacks inevitably leads to such bugs.

As why we do not apply such ingeniosity to left, it's above my current understanding.




2014-09-16 17:29 GMT+02:00 Frank Shearar <[hidden email]>:
On 16 September 2014 16:16,  <[hidden email]> wrote:
> Tobias Pape uploaded a new version of Graphics to project The Trunk:
> http://source.squeak.org/trunk/Graphics-topa.301.mcz
>
> ==================== Summary ====================
>
> Name: Graphics-topa.301
> Author: topa
> Time: 16 September 2014, 5:16:44.215 pm
> UUID: a66aac86-031b-4db4-97ce-e33376745f9e
> Ancestors: Graphics-mt.300
>
> Fix Mantis 5711
>         http://bugs.squeak.org/view.php?id=5711
> after 7 years...
>
> =============== Diff against Graphics-mt.300 ===============

Don't forget to tell Mantis that :)

frank




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-topa.301.mcz

Stéphane Rollandin
> Nice catch indeed.
> But, ouch!
>      (self left @ self top) ~= self topLeft...

Aaargh ! What ? This is not acceptable.


Stef


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-topa.301.mcz

Tobias Pape
In reply to this post by Nicolas Cellier
Hi,


On 16.09.2014, at 19:19, Nicolas Cellier <[hidden email]> wrote:

> Nice catch indeed.

Wasn't me, but some of our students.
They also found the dormant mantis entry…
I have no Idea why it works, to be honest.

> But, ouch!
>     (self left @ self top) ~= self topLeft...
> Without looking at the code, it sounds like heresy!
> Wouldn't the real fix be to name a cat a cat? (a corner a corner in this case).

Yes, it would.

>
> After a brief look at the code, of course things are not so simple.
> I'm not sure I completely understand the contracts, but inside the owner rectangular area, there are only some portions available for displaying text, and top answers the topMostAvailableDisplayArea...
> This fake insulate some users of top from the knowledge of this availableAreaForDisplay feature which sounds like a good thing...
> But in the same time, it fakes the innocent users of topLeft expecting top+left=topLeft.
> No matter the di initials (sorry to scratch an icon), but IMO it's a well too sophisticated hack, and such hacks inevitably leads to such bugs.
>
> As why we do not apply such ingeniosity to left, it's above my current understanding.
>
>
I  found that that container (as per some Class comment) can be a TextContainer _or_ a Rectangle.
And they apparently do different things on topLeft vs top @ left.
I have no idea :)

I had to convince myself again (I got the report 2month ago) that it indeed is the fix necessary…

Lets call a cat a cat.
Right after we fixed all the other stuff

>
>
> 2014-09-16 17:29 GMT+02:00 Frank Shearar <[hidden email]>:
> On 16 September 2014 16:16,  <[hidden email]> wrote:
> > Tobias Pape uploaded a new version of Graphics to project The Trunk:
> > http://source.squeak.org/trunk/Graphics-topa.301.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Graphics-topa.301
> > Author: topa
> > Time: 16 September 2014, 5:16:44.215 pm
> > UUID: a66aac86-031b-4db4-97ce-e33376745f9e
> > Ancestors: Graphics-mt.300
> >
> > Fix Mantis 5711
> >         http://bugs.squeak.org/view.php?id=5711
> > after 7 years...
> >
> > =============== Diff against Graphics-mt.300 ===============
>
> Don't forget to tell Mantis that :)
Can Frank or Nicolas do that please? I cannot.



Best
        -Tobias



signature.asc (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-topa.301.mcz

Nicolas Cellier


2014-09-16 20:08 GMT+02:00 Tobias Pape <[hidden email]>:
Hi,


On 16.09.2014, at 19:19, Nicolas Cellier <[hidden email]> wrote:

> Nice catch indeed.

Wasn't me, but some of our students.
They also found the dormant mantis entry…
I have no Idea why it works, to be honest.

> But, ouch!
>     (self left @ self top) ~= self topLeft...
> Without looking at the code, it sounds like heresy!
> Wouldn't the real fix be to name a cat a cat? (a corner a corner in this case).

Yes, it would.

>
> After a brief look at the code, of course things are not so simple.
> I'm not sure I completely understand the contracts, but inside the owner rectangular area, there are only some portions available for displaying text, and top answers the topMostAvailableDisplayArea...
> This fake insulate some users of top from the knowledge of this availableAreaForDisplay feature which sounds like a good thing...
> But in the same time, it fakes the innocent users of topLeft expecting top+left=topLeft.
> No matter the di initials (sorry to scratch an icon), but IMO it's a well too sophisticated hack, and such hacks inevitably leads to such bugs.
>
> As why we do not apply such ingeniosity to left, it's above my current understanding.
>
>

I  found that that container (as per some Class comment) can be a TextContainer _or_ a Rectangle.
And they apparently do different things on topLeft vs top @ left.
I have no idea :)

I had to convince myself again (I got the report 2month ago) that it indeed is the fix necessary…

Lets call a cat a cat.
Right after we fixed all the other stuff

>
>
> 2014-09-16 17:29 GMT+02:00 Frank Shearar <[hidden email]>:
> On 16 September 2014 16:16,  <[hidden email]> wrote:
> > Tobias Pape uploaded a new version of Graphics to project The Trunk:
> > http://source.squeak.org/trunk/Graphics-topa.301.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Graphics-topa.301
> > Author: topa
> > Time: 16 September 2014, 5:16:44.215 pm
> > UUID: a66aac86-031b-4db4-97ce-e33376745f9e
> > Ancestors: Graphics-mt.300
> >
> > Fix Mantis 5711
> >         http://bugs.squeak.org/view.php?id=5711
> > after 7 years...
> >
> > =============== Diff against Graphics-mt.300 ===============
>
> Don't forget to tell Mantis that :)

Can Frank or Nicolas do that please? I cannot.



Best
        -Tobias

 
Done,
But who could grant you more priviledges?



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-topa.301.mcz

Tobias Pape

On 17.09.2014, at 00:26, Nicolas Cellier <[hidden email]> wrote:

>
>
> 2014-09-16 20:08 GMT+02:00 Tobias Pape <[hidden email]>:
> Hi,
>
>
> On 16.09.2014, at 19:19, Nicolas Cellier <[hidden email]> wrote:
>
> > Nice catch indeed.
>
> Wasn't me, but some of our students.
> They also found the dormant mantis entry…
> I have no Idea why it works, to be honest.
>
> > But, ouch!
> >     (self left @ self top) ~= self topLeft...
> > Without looking at the code, it sounds like heresy!
> > Wouldn't the real fix be to name a cat a cat? (a corner a corner in this case).
>
> Yes, it would.
>
> >
> > After a brief look at the code, of course things are not so simple.
> > I'm not sure I completely understand the contracts, but inside the owner rectangular area, there are only some portions available for displaying text, and top answers the topMostAvailableDisplayArea...
> > This fake insulate some users of top from the knowledge of this availableAreaForDisplay feature which sounds like a good thing...
> > But in the same time, it fakes the innocent users of topLeft expecting top+left=topLeft.
> > No matter the di initials (sorry to scratch an icon), but IMO it's a well too sophisticated hack, and such hacks inevitably leads to such bugs.
> >
> > As why we do not apply such ingeniosity to left, it's above my current understanding.
> >
> >
>
> I  found that that container (as per some Class comment) can be a TextContainer _or_ a Rectangle.
> And they apparently do different things on topLeft vs top @ left.
> I have no idea :)
>
> I had to convince myself again (I got the report 2month ago) that it indeed is the fix necessary…
>
> Lets call a cat a cat.
> Right after we fixed all the other stuff
>
> >
> >
> > 2014-09-16 17:29 GMT+02:00 Frank Shearar <[hidden email]>:
> > On 16 September 2014 16:16,  <[hidden email]> wrote:
> > > Tobias Pape uploaded a new version of Graphics to project The Trunk:
> > > http://source.squeak.org/trunk/Graphics-topa.301.mcz
> > >
> > > ==================== Summary ====================
> > >
> > > Name: Graphics-topa.301
> > > Author: topa
> > > Time: 16 September 2014, 5:16:44.215 pm
> > > UUID: a66aac86-031b-4db4-97ce-e33376745f9e
> > > Ancestors: Graphics-mt.300
> > >
> > > Fix Mantis 5711
> > >         http://bugs.squeak.org/view.php?id=5711
> > > after 7 years...
> > >
> > > =============== Diff against Graphics-mt.300 ===============
> >
> > Don't forget to tell Mantis that :)
>
> Can Frank or Nicolas do that please? I cannot.
>
>
>
> Best
>         -Tobias
>
>  
> Done,
> But who could grant you more priviledges?
It's less about privilege than ineptitude on my part.



signature.asc (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-topa.301.mcz

Frank Shearar-3
In reply to this post by Nicolas Cellier
On 16 September 2014 23:26, Nicolas Cellier
<[hidden email]> wrote:

>
>
> 2014-09-16 20:08 GMT+02:00 Tobias Pape <[hidden email]>:
>>
>> Hi,
>>
>>
>> On 16.09.2014, at 19:19, Nicolas Cellier
>> <[hidden email]> wrote:
>>
>> > Nice catch indeed.
>>
>> Wasn't me, but some of our students.
>> They also found the dormant mantis entry…
>> I have no Idea why it works, to be honest.
>>
>> > But, ouch!
>> >     (self left @ self top) ~= self topLeft...
>> > Without looking at the code, it sounds like heresy!
>> > Wouldn't the real fix be to name a cat a cat? (a corner a corner in this
>> > case).
>>
>> Yes, it would.
>>
>> >
>> > After a brief look at the code, of course things are not so simple.
>> > I'm not sure I completely understand the contracts, but inside the owner
>> > rectangular area, there are only some portions available for displaying
>> > text, and top answers the topMostAvailableDisplayArea...
>> > This fake insulate some users of top from the knowledge of this
>> > availableAreaForDisplay feature which sounds like a good thing...
>> > But in the same time, it fakes the innocent users of topLeft expecting
>> > top+left=topLeft.
>> > No matter the di initials (sorry to scratch an icon), but IMO it's a
>> > well too sophisticated hack, and such hacks inevitably leads to such bugs.
>> >
>> > As why we do not apply such ingeniosity to left, it's above my current
>> > understanding.
>> >
>> >
>>
>> I  found that that container (as per some Class comment) can be a
>> TextContainer _or_ a Rectangle.
>> And they apparently do different things on topLeft vs top @ left.
>> I have no idea :)
>>
>> I had to convince myself again (I got the report 2month ago) that it
>> indeed is the fix necessary…
>>
>> Lets call a cat a cat.
>> Right after we fixed all the other stuff
>>
>> >
>> >
>> > 2014-09-16 17:29 GMT+02:00 Frank Shearar <[hidden email]>:
>> > On 16 September 2014 16:16,  <[hidden email]> wrote:
>> > > Tobias Pape uploaded a new version of Graphics to project The Trunk:
>> > > http://source.squeak.org/trunk/Graphics-topa.301.mcz
>> > >
>> > > ==================== Summary ====================
>> > >
>> > > Name: Graphics-topa.301
>> > > Author: topa
>> > > Time: 16 September 2014, 5:16:44.215 pm
>> > > UUID: a66aac86-031b-4db4-97ce-e33376745f9e
>> > > Ancestors: Graphics-mt.300
>> > >
>> > > Fix Mantis 5711
>> > >         http://bugs.squeak.org/view.php?id=5711
>> > > after 7 years...
>> > >
>> > > =============== Diff against Graphics-mt.300 ===============
>> >
>> > Don't forget to tell Mantis that :)
>>
>> Can Frank or Nicolas do that please? I cannot.
>>
>>
>>
>> Best
>>         -Tobias
>>
>
> Done,
> But who could grant you more priviledges?

I can, but I need a username. I had a look, but I don't think Tobias
has a bugs.squeak.org account?

frank