Commit 6e4b5819 authored by Filip Matijević's avatar Filip Matijević

[rotation] fix positioning bug when rotating by 180 degrees

parent b2e67dd5
...@@ -49,11 +49,13 @@ Item { ...@@ -49,11 +49,13 @@ Item {
var isPortrait = ((r === 0) || (r === 180)) var isPortrait = ((r === 0) || (r === 180))
var correction = 0 var correction = 0
var isNative=((privateProperties.nativeIsPortrait || isPortrait) && !(privateProperties.nativeIsPortrait && isPortrait)) //xor var isNative=((privateProperties.nativeIsPortrait || isPortrait) && !(privateProperties.nativeIsPortrait && isPortrait)) //xor
var diff = Math.abs(r - obj.rotation)
//xor //xor
if ((isNative || !privateProperties.nativeIsPortrait) && !(isNative && !privateProperties.nativeIsPortrait)) { if ((isNative || !privateProperties.nativeIsPortrait) && !(isNative && !privateProperties.nativeIsPortrait)) {
correction = obj.width / 2 - obj.height / 2 correction = obj.width / 2 - obj.height / 2
if (diff === 180)
correction = -correction
} }
var diff = Math.abs(r - obj.rotation)
obj.rotation = r obj.rotation = r
if ((diff === 90) || (diff === 270)) { if ((diff === 90) || (diff === 270)) {
var w = obj.width var w = obj.width
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment