Text.getImpl_caretShape returns strange results under certain conditions

Tom Schindl tom.schindl at bestsolution.at
Mon Nov 24 08:31:41 UTC 2014


I've just added some more debug information and for me the values I get
are reasonable and the bounds are identical but once the bug is wrong
and the next time it is right :-(

> ========== INVALID:   privat============
> Caret: [MoveTo[x=9.00146484375, y=105.0], LineTo[x=9.00146484375, y=120.0]]
> Text-Bounds: BoundingBox [minX:0.0, minY:0.0, minZ:0.0, width:72.01171875, height:15.0, depth:0.0, maxX:72.01171875, maxY:15.0, maxZ:0.0]
> Wrapping-Width: 0.0
> Text-Flow:BoundingBox [minX:0.0, minY:0.0, minZ:0.0, width:72.01171875, height:15.0, depth:0.0, maxX:72.01171875, maxY:15.0, maxZ:0.0]
> ========== VALID:   privat============
> Caret: [MoveTo[x=9.00146484375, y=0.0], LineTo[x=9.00146484375, y=15.0]]
> Text-Bounds: BoundingBox [minX:0.0, minY:0.0, minZ:0.0, width:72.01171875, height:15.0, depth:0.0, maxX:72.01171875, maxY:15.0, maxZ:0.0]
> Wrapping-Width: 0.0
> Text-Flow:BoundingBox [minX:0.0, minY:0.0, minZ:0.0, width:72.01171875, height:15.0, depth:0.0, maxX:72.01171875, maxY:15.0, maxZ:0.0]

Jim can you point me to the bug you fixed?

Tom

On 24.11.14 09:08, Tom Schindl wrote:
> The thing I can confirm is that the Text is inside a TextFlow but I'm
> fairly unable to provide a test-case because it happens at random times
> - I'll try to update to the latest u40 build to see if the fix from Jim
> helps me.
> 
> For the time being I was able to work around the problem by adjusting
> the PathElements returned to be never larger then the text-elements
> height which too me sounds like a reasonable constraint because I can't
> think of a situation where the caret should ever be larger than the
> Text-Bounds.
> 
> Tom
> 
> On 24.11.14 02:49, Felipe Heidrich wrote:
>> Hi Tom,
>>
>> Without a reproducible testcase it is hard to see what is happening. Are you using Text or TextFlow ?
>> For some reason the Text.getImpl_caretShape() seems to think the caret is in the 8th line, which seems to indicate there is some line wrapping width set when it should not (Jim just fixed a bug in that code last week).
>>
>> Regards,
>> Felipe
>>
>>
>>> On Nov 23, 2014, at 11:04 AM, Tom Schindl <tom.schindl at bestsolution.at> wrote:
>>>
>>> Hi,
>>>
>>> I was debugging a problem in my StyledText-Source editor today and found
>>> one of my layout problems is that ListCells (the inner representation of
>>> the editor lines is simply ListView) sometime get really strange heights
>>> assigned.
>>>
>>> To display a caret in the UI I'm creating a caret-Shape using
>>> Text.getImpl_caretShape but this is causeing my layout problems because
>>> under certain conditions the returned cursor is completely wrong.
>>>
>>> Look for example at the following example. The first line is the bounds
>>> of the Text-Element with the content (privata) and the 2nd is the Path
>>> created by Text.getImpl_caretShape
>>>
>>>> BoundingBox [minX:0.0, minY:0.0, minZ:0.0, width:81.01318359375, height:15.0, depth:0.0, maxX:81.01318359375, maxY:15.0, maxZ:0.0]
>>>>  privata ===> [MoveTo[x=9.00146484375, y=120.0], LineTo[x=9.00146484375, y=135.0]]
>>>
>>> the correct path is [MoveTo[x=9.00146484375, y=0.0],
>>> LineTo[x=9.00146484375, y=15.0]]
>>>
>>>
>>> I've been able to work around this problem for the time being. Anyone an
>>> idea what is causing this completely invalid caretShape?
>>>
>>> Tom
>>>
>>> -- 
>>> Thomas Schindl, CTO
>>> BestSolution.at EDV Systemhaus GmbH
>>> Eduard-Bodem-Gasse 5-7, A-6020 Innsbruck
>>> http://www.bestsolution.at/
>>> Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
>>
> 
> 


-- 
Thomas Schindl, CTO
BestSolution.at EDV Systemhaus GmbH
Eduard-Bodem-Gasse 5-7, A-6020 Innsbruck
http://www.bestsolution.at/
Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck


More information about the openjfx-dev mailing list