FogBugz (Dossier [Issue]12067) Morphic - A TextAnchor should never try to placeEmbeddedObject: by itself

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

FogBugz (Dossier [Issue]12067) Morphic - A TextAnchor should never try to placeEmbeddedObject: by itself

Pharo Issue Tracker
Ouvert par Nicolas Cellier.

N° de dossier : 12067
Intitulé :    A TextAnchor should never try to placeEmbeddedObject: by itself
État:         Work Needed
Catégorie:    Bug
Projet :      Morphic
Zone :        1. Pharo Image
Priorité :    5 - Fix If Time
Version :     Later
Attribué à:   Everyone

URL :         https://pharo.fogbugz.com/f/cases/12067

From Squeak trunk:
Name: Morphic-nice.695
Author: nice
Time: 5 October 2013, 12:05:58.658 am
UUID: c0320b47-c05e-4f35-ae13-9faee7640629
Ancestors: Morphic-nice.694

A TextAnchor should not try to directly #placeEmbeddedObject: when emphasizing the scanner.
Indeed, a scanner requests the Text to apply emphasis/attributes at an initialization stage (setFont).
It is the scanner scan loop which is responsible for composing the text.
Since this initialization happens outside the scan loop, the scanner is not yet ready to place anything.

The placement will happen later when the scanner is willing to, by the following mechanism:
- every TextAnchor is associated with a (Character value: 1).
- there is a stopCondition associated to this value which will be processed in the scan loop and invoke #embeddedObject.
- #embeddedObject will send #placeEmbeddedObject:

Restoring this method from 12 years ago fixes a glitch when the embedded morph crosses the right margin.
The glitch is due to a setFont which is sent from inside the scan loop in some conditions and incorrectly increments twice the morph display position.


Vous êtes abonné(e) à ce dossier. Si vous ne souhaitez plus recevoir de notifications automatiques à l'avenir, désabonnez-vous (https://pharo.fogbugz.com/default.asp?pre=preUnsubscribe&pg=pgEditBug&command=view&ixBug=12067) de ce dossier.

_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker