mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-26 00:58:47 +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
|
property bool pinned: false
|
||||||
clip: true
|
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();
|
onButtonStateChanged: updateYOffset();
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|
Loading…
Reference in a new issue