The Trunk: Graphics-pre.439.mcz

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

The Trunk: Graphics-pre.439.mcz

commits-2
Patrick Rein uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-pre.439.mcz

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

Name: Graphics-pre.439
Author: pre
Time: 25 September 2020, 9:48:35.481674 am
UUID: e6d3328b-645a-e846-a3a9-c3c61b479c23
Ancestors: Graphics-tonyg.438

Adds code to handle the case in which a text anchor attribute is used on more than the SoH character AND another SoH character is within the range where the text anchor was applied. Without this, the first morph would be put at the location of the second SoH character.

=============== Diff against Graphics-tonyg.438 ===============

Item was changed:
  ----- Method: CharacterScanner>>embeddedObject (in category 'stop conditions') -----
  embeddedObject
 
+ | previousAttributes newAttributes |
  pendingKernX := 0.
+ "If a text anchor was already at the previous index, it was already dealt with"
+ previousAttributes := lastIndex > 1 ifTrue: [text attributesAt: lastIndex - 1] ifFalse: [#()].
+ newAttributes := (text attributesAt: lastIndex) copyWithoutAll: previousAttributes.
+ (newAttributes reject: [:each | each anchoredMorph isNil])
- ((text attributesAt: lastIndex) reject: [:each | each anchoredMorph isNil])
  ifNotEmpty: [:attributes | (self placeEmbeddedObjectsFrom: attributes) ifTrue: [^ true]].
  self setFont.
   
  "Note: if ever several objects are embedded on same character, only indent lastIndex once"
  lastIndex := lastIndex + 1.
+ ^ false!
- ^false!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-pre.439.mcz

Jakob Reschke
What is an SoH character? Does not look like ASCII 001 is meant here.

Am Fr., 25. Sept. 2020 um 09:48 Uhr schrieb <[hidden email]>:

>
> Patrick Rein uploaded a new version of Graphics to project The Trunk:
> http://source.squeak.org/trunk/Graphics-pre.439.mcz
>
> ==================== Summary ====================
>
> Name: Graphics-pre.439
> Author: pre
> Time: 25 September 2020, 9:48:35.481674 am
> UUID: e6d3328b-645a-e846-a3a9-c3c61b479c23
> Ancestors: Graphics-tonyg.438
>
> Adds code to handle the case in which a text anchor attribute is used on more than the SoH character AND another SoH character is within the range where the text anchor was applied. Without this, the first morph would be put at the location of the second SoH character.
>
> =============== Diff against Graphics-tonyg.438 ===============
>
> Item was changed:
>   ----- Method: CharacterScanner>>embeddedObject (in category 'stop conditions') -----
>   embeddedObject
>
> +       | previousAttributes newAttributes |
>         pendingKernX := 0.
> +       "If a text anchor was already at the previous index, it was already dealt with"
> +       previousAttributes := lastIndex > 1 ifTrue: [text attributesAt: lastIndex - 1] ifFalse: [#()].
> +       newAttributes := (text attributesAt: lastIndex) copyWithoutAll: previousAttributes.
> +       (newAttributes reject: [:each | each anchoredMorph isNil])
> -       ((text attributesAt: lastIndex) reject: [:each | each anchoredMorph isNil])
>                 ifNotEmpty: [:attributes | (self placeEmbeddedObjectsFrom: attributes) ifTrue: [^ true]].
>         self setFont.
>
>         "Note: if ever several objects are embedded on same character, only indent lastIndex once"
>         lastIndex := lastIndex + 1.
> +       ^ false!
> -       ^false!
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-pre.439.mcz

marcel.taeumel
Hi Jakob,

it is start-of-heading (SOH, 001). See https://en.wikipedia.org/wiki/Control_character#Transmission_control It is a compromise for "non-data section of a data stream" :-) That is, the morph or form.

Best,
Marcel

Am 25.09.2020 18:41:04 schrieb Jakob Reschke <[hidden email]>:

What is an SoH character? Does not look like ASCII 001 is meant here.

Am Fr., 25. Sept. 2020 um 09:48 Uhr schrieb :
>
> Patrick Rein uploaded a new version of Graphics to project The Trunk:
> http://source.squeak.org/trunk/Graphics-pre.439.mcz
>
> ==================== Summary ====================
>
> Name: Graphics-pre.439
> Author: pre
> Time: 25 September 2020, 9:48:35.481674 am
> UUID: e6d3328b-645a-e846-a3a9-c3c61b479c23
> Ancestors: Graphics-tonyg.438
>
> Adds code to handle the case in which a text anchor attribute is used on more than the SoH character AND another SoH character is within the range where the text anchor was applied. Without this, the first morph would be put at the location of the second SoH character.
>
> =============== Diff against Graphics-tonyg.438 ===============
>
> Item was changed:
> ----- Method: CharacterScanner>>embeddedObject (in category 'stop conditions') -----
> embeddedObject
>
> + | previousAttributes newAttributes |
> pendingKernX := 0.
> + "If a text anchor was already at the previous index, it was already dealt with"
> + previousAttributes := lastIndex > 1 ifTrue: [text attributesAt: lastIndex - 1] ifFalse: [#()].
> + newAttributes := (text attributesAt: lastIndex) copyWithoutAll: previousAttributes.
> + (newAttributes reject: [:each | each anchoredMorph isNil])
> - ((text attributesAt: lastIndex) reject: [:each | each anchoredMorph isNil])
> ifNotEmpty: [:attributes | (self placeEmbeddedObjectsFrom: attributes) ifTrue: [^ true]].
> self setFont.
>
> "Note: if ever several objects are embedded on same character, only indent lastIndex once"
> lastIndex := lastIndex + 1.
> + ^ false!
> - ^false!
>
>