The Trunk: Graphics-pre.424.mcz

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

The Trunk: Graphics-pre.424.mcz

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

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

Name: Graphics-pre.424
Author: pre
Time: 14 November 2019, 4:32:50.472053 pm
UUID: bbaa1a3d-78d0-0c42-ba47-0c1949e20cca
Ancestors: Graphics-pre.423

Refactors the embedded object callback to allow for handling cases in which several TextAnchors are attached to the same character. Also allows TextAnchors to change the style of the text by letting TextAnchors work on the scanner (as other TextAttributes are allowed to do).

=============== Diff against Graphics-pre.423 ===============

Item was changed:
  ----- Method: CharacterScanner>>embeddedObject (in category 'stop conditions') -----
  embeddedObject
 
  pendingKernX := 0.
  ((text attributesAt: lastIndex) reject: [:each | each anchoredMorph isNil])
+ ifNotEmpty: [:attributes | self placeEmbeddedObjectsFrom: attributes].
+ self setFont.
- ifNotEmpty: [:attributes | attributes do: [:attr |
- "Try to placeEmbeddedObject: - if it answers false, then there's no place left"
- (self placeEmbeddedObjectFrom: attr) ifFalse: [^ self crossedX]]].
   
  "Note: if ever several objects are embedded on same character, only indent lastIndex once"
  lastIndex := lastIndex + 1.
  ^false!

Item was changed:
+ ----- Method: CharacterScanner>>placeEmbeddedObjectFrom: (in category 'private-text-anchor') -----
- ----- Method: CharacterScanner>>placeEmbeddedObjectFrom: (in category 'private') -----
  placeEmbeddedObjectFrom: aTextAttribute
  "Place the anchoredMorph or return false if it cannot be placed"
  ^ true!

Item was added:
+ ----- Method: CharacterScanner>>placeEmbeddedObjectsFrom: (in category 'private-text-anchor') -----
+ placeEmbeddedObjectsFrom: textAttributes
+ textAttributes do: [:attr |
+ "Try to placeEmbeddedObject: - if it answers false, then there's no place left"
+ (self placeEmbeddedObjectFrom: attr) ifFalse: [^ self crossedX]]!