On Wed, 7 Feb 2024 15:57:35 GMT, John Hendrikx <jhendr...@openjdk.org> wrote:

>> one thing: you may sync up with the latest master branch, that's the 
>> configuration I am testing.
>
> @andy-goryachev-oracle
> 
> I'm not quite seeing what you are seeing.  Here is a screenshots of `LOGICAL` 
> setting with the text `The   quick   brown   fox   jumps   over   the   lazy  
>  dog`; notice that there is a horizontal scroll bar -- that looks incorrect:
> 
> ![image](https://github.com/openjdk/jfx/assets/995917/0ce6b106-2fd6-4688-9f3c-ba7ec23484ad)
> 
> Now, for the `VISUAL` setting it is a bit hard to see if it is doing the 
> right thing because the `Text` node is lacking any kind of border to see 
> where the actual bounds are.  However, I do clearly see it responding to 
> underline on/off, so it is taking that into account somehow (which makes 
> sense for `VISUAL`)
> 
> `VISUAL` with underline on (notice scroll bar):
> 
> ![image](https://github.com/openjdk/jfx/assets/995917/90d770fc-3001-4492-ae68-0359739e81d9)
> 
> And off (notice scroll bar is gone):
> 
> ![image](https://github.com/openjdk/jfx/assets/995917/6171ec23-9a2f-4b13-81ff-5bfe999b1f30)
> 
> So, it seems that:
> - Logical bounds still have a bug where the `Text` is getting a scroll bar
> - Visual bounds seem to be what you'd expect (I see no bugs -- text is 
> correctly aligned with respect to **other** lines, but there may be trailing 
> spaces that take up additional visual space which results in the overall 
> alignment to be off (ie. right aligned text is not touching the right most 
> edge, since there are spaces there, but **only** when strike through or 
> underline is on (!!) ) -- again it is bit hard to tell as there is no border 
> to see where the visual bounds really are -- you have to look at the 
> horizonal scroll bar :)

> @hjohn are you trying a single line? Try this string:
> 
> ```
> The quick brown fox jumps over the lazy dog     
>     The quick brown fox jumps over the lazy dog     
> ```
> 
> ![Screenshot 2024-02-07 at 14 50 
> 56](https://private-user-images.githubusercontent.com/107069028/303159866-b883d887-c16a-4af4-bd17-21ba9b8fdec6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDczNDY2NDUsIm5iZiI6MTcwNzM0NjM0NSwicGF0aCI6Ii8xMDcwNjkwMjgvMzAzMTU5ODY2LWI4ODNkODg3LWMxNmEtNGFmNC1iZDE3LTIxYmE5YjhmZGVjNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDIwN1QyMjUyMjVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00YzcxYzMyYWM3ZGY4OTgxMzIxZTNhYzAzMmUxNTk0NDExNTQ4NjQyMzUxNmM2OWYxMzQ2YTQxOGJjOTMzZjAxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.OAwnWRI6Y7Qfy-p4KXB_MJPtC0wRBKIdztQXix2F7iA)

Well, wrap text is on, so that allows the code to strip spaces between words if 
it places a soft wrap there (which is working).  At the end of the first line, 
it doesn't want to wrap yet, but a hard wrap is encountered (`\n`).  Since 
there is no soft wrap there, the spaces are kept intact.

The question really is if this is correct for the 2nd line.  There is no soft 
wrap at the 2nd `dog`, so why is it stripping spaces there?  I don't have a 
test case for that one yet in my `TextLayoutTest` but I will add one.  For the 
2nd line it is stripping **trailing** spaces (not spaces between words where a 
soft wrap occurred), so I think that the 2nd line is incorrect.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1236#issuecomment-1933109332

Reply via email to