-
Notifications
You must be signed in to change notification settings - Fork 236
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
PopupDemo regression #220
Comments
The regression doesn't exist as of 7277f9f (the last commit before the skin was removed), but shows up somewhere after I removed the skin. When my work was merged in 45145ff, this regression appears. I've narrowed it down to this. When user types/deletes a character, the following path occurs: layoutChildren() // calls positionPopup()
---
positionPopup() { // calls getSelectionBoundsOnScreen()
switch(alignment.getAnchorObject()) {
case CARET:
bounds = getCaretBoundsOnScreen(); break;
case SELECTION:
bounds = getSelectionBoundsOnScreen(); break;
}
// at this point, bounds is null when it should have a value to which
// popup would position itself.
bounds.ifPresent(b -> { /* code */ })
}
---
getSelectionBoundsOnScreen() {
// calls getCaretBoundsOnScreen
// since selection's length is 0
IndexRange selection = getSelection();
if(selection.getLength() == 0) {
return getCaretBoundsOnScreen();
}
}
---
getCaretBoundsOnScreen() {
// virtualFlow.getCellIfVisible(getCurrentParagraph()).isPresent() == false
return virtualFlow.getCellIfVisible(getCurrentParagraph())
.map(c -> c.getNode().getCaretBoundsOnScreen());
} |
Edit: PopupDemo uses the PopupAlignment: Tomas, when a user selects text from the left and going right in the demo, should the popup be (almost) directly underneath where the caret is as it progresses to the right? When I positioned the caret somewhere, pressed and held Shift, and used the right arrow to further select characters on the right, the popup didn't line up vertically with the caret. |
Changing Cell<Paragraph<S, PS>, ParagraphBox<S, PS>> cell = virtualFlow.getCell(getCurrentParagraph());
if (virtualFlow.visibleCells().contains(cell)) {
return Optional.of(cell.getNode().getCaretBoundsOnScreen())
} |
The code on the commit immediately after 7277f9f (where Flowless is updated to the then-current 0.5-Snapshot) works, so I guess it really is some thing caused in my code and not Flowless's new version. |
When a user types a letter, The necessary bounds that would update the popup position are not present in the first call but are in the second. So, I'm guessing that my code somehow prevents the second call to |
Ok, I redid a one of my skin-removal commits (I inlined StyledTextAreaView's content into StyledTextArea) in my branch "regressionCheck", along with a few other commits that later followed: popupAnchorAdjustment's naming conflict and removing a reference to view/virtualFlow in In this branch's second-to-last commit, there is no regression in the code. Despite comparing the differences between However, I have found that the regression does appear in So, the last commit in the branch (currently |
Wrapping |
Turns out this was a deficiency in Flowless. See #238 and FXMisc/Flowless#19 |
Fixed by FXMisc/Flowless#20 |
There is a regression in the PopupDemo (
gradle PopupDemo
), introduced after 0.6.10: the position of the popup does not update as I type.The text was updated successfully, but these errors were encountered: