Hi,



On Wed, Jul 23, 2014 at 9:52 AM, Thierry Goubier <thierry.goubier@gmail.com> wrote:



2014-07-23 8:00 GMT+02:00 Tudor Girba <tudor@tudorgirba.com>:

Hi,

In GTInspector we use a TransformMorph inside the pager morph. It works fine, but spawning completion from a text morph that is placed inside this transform morph, the completion morphs appears in the wrong place.

The issue comes from submorphBounds apparently not being right (this is what the completion morph relies on).

Here is a simpler example, to exemplify what I am talking about:

circle := CircleMorph new.
morph := TransformMorph new.
morph addMorph: circle.
morph top: 100.
morph left: 100.
morph submorphBounds. "==> (100@100) corner: (140@140)"
circle submorphBounds. "==>��(0@0) corner: (40@40)"
��
This seems correct to me: a transformMorph is the one which shift its contents (and reset the origin to its top left corner ?).

Not really. The contract of submorphBounds should be that it returns an absolute coordinate, as far as I understand.
��
Why do you use a TransformMorph there?

It is used for example in ScrollPane. This means that if you embed a TextMorph inside a ScrollPane, you will have the same problem with completion:

scrollPane := ScrollPane new.
pasteUpMorph := PasteUpMorph new.
scrollPane scroller addMorph: pasteUpMorph.
scrollPane openInWindow top: 100; left: 100.

pasteUpMorph submorphBounds "(0@0) corner: (50@40)"

Cheers,
Doru

��
Thierry


Ideally, "circle submorphBounds" should start at 100@100. Is this a bug, or am I doing something wrong?

Cheers,
Doru

--

"Every thing has its own flow"




--
www.tudorgirba.com

"Every thing has its own flow"