File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
korge/src/korlibs/korge/view/align Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -5,15 +5,15 @@ import korlibs.korge.view.*
55
66/* * Chainable method returning this that sets [this] View in the middle between [x1] and [x2] */
77fun <T : View > T.centerXBetween (x1 : Double , x2 : Double ): T {
8- this .x = (x2 + x1 - this .width ) / 2
8+ this .x = (x2 + x1 - this .scaledWidth ) / 2
99 return this
1010}
1111fun <T : View > T.centerXBetween (x1 : Float , x2 : Float ): T = centerXBetween(x1.toDouble(), x2.toDouble())
1212fun <T : View > T.centerXBetween (x1 : Int , x2 : Int ): T = centerXBetween(x1.toDouble(), x2.toDouble())
1313
1414/* * Chainable method returning this that sets [this] View in the middle between [y1] and [y2] */
1515fun <T : View > T.centerYBetween (y1 : Double , y2 : Double ): T {
16- this .y = (y2 + y1 - this .height ) / 2
16+ this .y = (y2 + y1 - this .scaledHeight ) / 2
1717 return this
1818}
1919fun <T : View > T.centerYBetween (y1 : Float , y2 : Float ): T = centerYBetween(y1.toDouble(), y2.toDouble())
You can’t perform that action at this time.
0 commit comments