The Inbox: Morphic-cao.522.mcz

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

The Inbox: Morphic-cao.522.mcz

commits-2
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-cao.522.mcz

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

Name: Morphic-cao.522
Author: cao
Time: 28 February 2011, 6:22:34.55 pm
UUID: 4be5ac71-d5df-4e96-b59c-5065ad7932f9
Ancestors: Morphic-mtf.521

StringMorph>>contents: shouldn't mutate fonts in the
test attributes.

=============== Diff against Morphic-mtf.521 ===============

Item was changed:
  ----- Method: StringMorph>>contents: (in category 'accessing') -----
  contents: newContents
  | scanner |
  contents := newContents isText
  ifTrue: [scanner := StringMorphAttributeScanner new initializeFromStringMorph: self.
  (newContents attributesAt: 1 forStyle: self font textStyle)
  do: [:attr | attr emphasizeScanner: scanner].
  emphasis := scanner emphasis.
+ font := scanner font.
- font := scanner font emphasis: emphasis.
  color := scanner textColor.
  newContents string]
  ifFalse: [contents = newContents
  ifTrue: [^ self].
  "no substantive change"
  newContents].
  self fitContents!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-cao.522.mcz

Levente Uzonyi-2
On Mon, 28 Feb 2011, [hidden email] wrote:

> A new version of Morphic was added to project The Inbox:
> http://source.squeak.org/inbox/Morphic-cao.522.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-cao.522
> Author: cao
> Time: 28 February 2011, 6:22:34.55 pm
> UUID: 4be5ac71-d5df-4e96-b59c-5065ad7932f9
> Ancestors: Morphic-mtf.521
>
> StringMorph>>contents: shouldn't mutate fonts in the
> test attributes.

Can you provide a simple test case that shows the effect of this change
for someone who's not familiar with the code (like me)?


Levente

>
> =============== Diff against Morphic-mtf.521 ===============
>
> Item was changed:
>  ----- Method: StringMorph>>contents: (in category 'accessing') -----
>  contents: newContents
>   | scanner |
>   contents := newContents isText
>   ifTrue: [scanner := StringMorphAttributeScanner new initializeFromStringMorph: self.
>   (newContents attributesAt: 1 forStyle: self font textStyle)
>   do: [:attr | attr emphasizeScanner: scanner].
>   emphasis := scanner emphasis.
> + font := scanner font.
> - font := scanner font emphasis: emphasis.
>   color := scanner textColor.
>   newContents string]
>   ifFalse: [contents = newContents
>   ifTrue: [^ self].
>   "no substantive change"
>   newContents].
>   self fitContents!
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-cao.522.mcz

Christopher Oliver
In reply to this post by commits-2
Easy example:

        EmphasizedMenu example1.

Try this (DoIt) twice both without and with the patch.

--
Christopher Oliver


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-cao.522.mcz

Levente Uzonyi-2
On Sun, 6 Mar 2011, Christopher Oliver wrote:

> Easy example:
>
> EmphasizedMenu example1.
>
> Try this (DoIt) twice both without and with the patch.

Thanks, great example. :)


Levente

>
> --
> Christopher Oliver
>
>
>