mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-23 01:44:22 +00:00
Offset TextEditor::getTextBounds() by viewport position
This commit is contained in:
parent
f3aa49e0d3
commit
361b29edb6
2 changed files with 6 additions and 1 deletions
|
|
@ -1498,7 +1498,9 @@ RectangleList<int> TextEditor::getTextBounds (Range<int> textRange)
|
|||
}
|
||||
}
|
||||
|
||||
boundingBox.offsetAll (getLeftIndent(), roundToInt ((float) getTopIndent() + yOffset));
|
||||
boundingBox.offsetAll (getLeftIndent() - viewport->getViewPositionX(),
|
||||
roundToInt ((float) getTopIndent() + yOffset) - viewport->getViewPositionY());
|
||||
|
||||
return boundingBox;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -537,6 +537,9 @@ public:
|
|||
|
||||
/** Returns the bounding box for a range of text in the editor. As the range may span
|
||||
multiple lines, this method returns a RectangleList.
|
||||
|
||||
The bounds are relative to the component's top-left and may extend beyond the bounds
|
||||
of the component if the text is long and word wrapping is disabled.
|
||||
*/
|
||||
RectangleList<int> getTextBounds (Range<int> textRange);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue