Buttons, mostly
This commit is contained in:
1 parent
750e24f724
commit
888f7da214
6 files changed
+61
-55
No files matched your search
@@ -31,7 +31,6 @@ function DoLayout() as void
|
||||
iconWidth = 0
|
||||
iconHeight = 0
|
||||
textWidth = 0
|
||||
textHeight = 0
|
||||
iconTextSpacing = 0
|
||||
|
||||
if iconVisible
|
||||
@@ -43,7 +42,6 @@ function DoLayout() as void
|
||||
if textVisible
|
||||
labelRect = m.labelNode.boundingRect()
|
||||
textWidth = labelRect.width
|
||||
textHeight = labelRect.height
|
||||
contentWidth += textWidth
|
||||
end if
|
||||
|
||||
@@ -65,8 +63,8 @@ function DoLayout() as void
|
||||
|
||||
if textVisible
|
||||
x = (width - contentWidth) / 2 + padding[0] + iconWidth + iconTextSpacing
|
||||
y = (height - textHeight) / 2
|
||||
m.labelNode.translation = [x, y]
|
||||
m.labelNode.height = height
|
||||
m.labelNode.translation = [x, 0]
|
||||
end if
|
||||
|
||||
OnAnchorChange()
|
||||
@@ -77,6 +75,7 @@ function OnAnchorChange()
|
||||
height = m.top.height
|
||||
anchor = m.top.anchor
|
||||
|
||||
m.anchorNode.scaleRotateCenter = [width / 2, height / 2]
|
||||
m.anchorNode.translation = [-width * anchor[0], -height * anchor[1]]
|
||||
end function
|
||||
|
||||
|
||||
Reference in new issue
Block a user