Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8307117: TextArea: wrapText property ignored when changing font #1217

Closed

Conversation

andy-goryachev-oracle
Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle commented Aug 21, 2023

Requesting content layout when font changes.

This change makes the visual impact of JDK-8314683 more visible, so perhaps both bugs should be fixed at the same time.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8307117: TextArea: wrapText property ignored when changing font (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1217/head:pull/1217
$ git checkout pull/1217

Update a local copy of the PR:
$ git checkout pull/1217
$ git pull https://git.openjdk.org/jfx.git pull/1217/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1217

View PR using the GUI difftool:
$ git pr show -t 1217

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1217.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 21, 2023

👋 Welcome back angorya! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 16, 2023

@andy-goryachev-oracle This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@andy-goryachev-oracle
Copy link
Contributor Author

keep alive

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 12, 2023

@andy-goryachev-oracle This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@andy-goryachev-oracle
Copy link
Contributor Author

keep alive

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 6, 2024

@andy-goryachev-oracle This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@andy-goryachev-oracle
Copy link
Contributor Author

on second thought, let's address this independently of JDK-8314683.

@andy-goryachev-oracle andy-goryachev-oracle marked this pull request as ready for review February 6, 2024 22:14
@openjdk openjdk bot added the rfr Ready for review label Feb 6, 2024
@mlbridge
Copy link

mlbridge bot commented Feb 6, 2024

Webrevs

@kevinrushforth
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Feb 7, 2024

@kevinrushforth
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@kevinrushforth
Copy link
Member

Reviewers: @arapte @karthikpandelu

This seems reasonable, but I'll let Ambarish and Karthik review. My only question is whether it would it be possible to create an automated test for this?

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: year should be 2024.
We update copyright years in bulk before releases/new year, so in general one can avoid changing copyright year along with fix.

@arapte
Copy link
Member

arapte commented Feb 7, 2024

With this change observed a behavior that: When changing font size from smaller size to larger size such that larger size font does not fit in one line, text is first layouted vertically and then layouted horizontally.
Sharing screen capture:

visible-relayout-flicker-like-feel.mov

I tried adding few more calls to the listener as below, but it did not change the behavior:

registerChangeListener(control.fontProperty(), e -> {
    invalidateMetrics();
    updateFontMetrics();
    control.requestLayout();
    contentView.requestLayout();
});

@karthikpandelu
Copy link
Member

I can also see the same behaviour which @arapte mentioned above.

@andy-goryachev-oracle
Copy link
Contributor Author

The flicker you see is a subject of another ticket, JDK-8305003.
Possibly caused by JDK-8097060.

@openjdk openjdk bot removed the rfr Ready for review label Feb 7, 2024
@openjdk openjdk bot added the rfr Ready for review label Feb 7, 2024
@karthikpandelu
Copy link
Member

The flickering looks to be gone now but I see another issue. When the font size is changed from larger value like 144 to a smaller value like 10, the position of text in the TextArea shifts.
Screenshot 2024-02-08 at 3 35 50 PM
When monkey tester window loses focus, it goes back to the original position.

Steps to reproduce the issue:

  1. Open the MonkeyTester with TextArea having larger font size like 144. (If smaller font size is present, change the font size without clicking on the text)
  2. Click on the text to get caret.
  3. Change font size to 10.
  4. Click on the text to get caret again, the text shifts.

Not sure if this is related to the other issues you have mentioned in this PR before.

@andy-goryachev-oracle
Copy link
Contributor Author

the position of text in the TextArea shifts.

yes, that's JDK-8314683
the padding size is expressed in ems which is incorrect - it should be fixed like everywhere else.

@andy-goryachev-oracle
Copy link
Contributor Author

would it be possible to create an automated test for this?

created a robot test.

Copy link
Member

@karthikpandelu karthikpandelu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openjdk
Copy link

openjdk bot commented Feb 12, 2024

@andy-goryachev-oracle This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8307117: TextArea: wrapText property ignored when changing font

Reviewed-by: kpk, arapte

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 2 new commits pushed to the master branch:

  • a39732a: 8311492: FontSmoothingType LCD produces wrong color when transparency is used
  • 172c491: 8312603: ArrayIndexOutOfBoundsException in Marlin when scaleX is 0

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Ready to be integrated label Feb 12, 2024
@andy-goryachev-oracle
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Feb 12, 2024

Going to push as commit de0255d.
Since your change was applied there have been 3 commits pushed to the master branch:

  • a7f6de8: 8325258: Additional WebKit 617.1 fixes from WebKitGTK 2.42.5
  • a39732a: 8311492: FontSmoothingType LCD produces wrong color when transparency is used
  • 172c491: 8312603: ArrayIndexOutOfBoundsException in Marlin when scaleX is 0

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 12, 2024
@openjdk openjdk bot closed this Feb 12, 2024
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review labels Feb 12, 2024
@openjdk
Copy link

openjdk bot commented Feb 12, 2024

@andy-goryachev-oracle Pushed as commit de0255d.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@andy-goryachev-oracle andy-goryachev-oracle deleted the 8307117.wrap branch February 12, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants