mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix steppy scrolling if the content component of a viewport was transformed
This commit is contained in:
parent
142ce5eb84
commit
035f865099
1 changed files with 7 additions and 2 deletions
|
|
@ -110,8 +110,13 @@ int Viewport::getMaximumVisibleHeight() const { return contentHolder.getHeight
|
|||
Point<int> Viewport::viewportPosToCompPos (Point<int> pos) const
|
||||
{
|
||||
jassert (contentComp != nullptr);
|
||||
return Point<int> (jmax (jmin (0, contentHolder.getWidth() - contentComp->getWidth()), jmin (0, -(pos.x))),
|
||||
jmax (jmin (0, contentHolder.getHeight() - contentComp->getHeight()), jmin (0, -(pos.y))));
|
||||
|
||||
Rectangle<int> contentBounds = contentHolder.getLocalArea (contentComp, contentComp->getLocalBounds());
|
||||
Point<int> p (jmax (jmin (0, contentHolder.getWidth() - contentBounds.getWidth()), jmin (0, -(pos.x))),
|
||||
jmax (jmin (0, contentHolder.getHeight() - contentBounds.getHeight()), jmin (0, -(pos.y))));
|
||||
|
||||
|
||||
return p.transformedBy (contentComp->getTransform().inverted());
|
||||
}
|
||||
|
||||
void Viewport::setViewPosition (const int xPixelsOffset, const int yPixelsOffset)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue