mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Check if offset outside image, set to last image
This commit is contained in:
parent
b9c7d6351f
commit
9a563ba02f
1 changed files with 4 additions and 1 deletions
|
@ -12,7 +12,10 @@ Item {
|
|||
property bool pinned: false
|
||||
clip: true
|
||||
|
||||
function updateYOffset() { yOffset = size * buttonState; }
|
||||
function updateYOffset() {
|
||||
//make sure offset not set outside image
|
||||
yOffset = (size * buttonState >= image.height) ? image.height - size : size * buttonState
|
||||
}
|
||||
onButtonStateChanged: updateYOffset();
|
||||
|
||||
Component.onCompleted: {
|
||||
|
|
Loading…
Reference in a new issue