Skip to content

Commit 6e527a4

Browse files
committed
WindowBase: Add _density to bind list of width and height and remove caching center property.
1 parent 9da08a5 commit 6e527a4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

kivy/core/window/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def _get_width(self):
490490
return _size[0]
491491
return _size[1]
492492

493-
width = AliasProperty(_get_width, bind=('_rotation', '_size'))
493+
width = AliasProperty(_get_width, bind=('_rotation', '_size', '_density'))
494494
'''Rotated window width.
495495
496496
:attr:`width` is a read-only :class:`~kivy.properties.AliasProperty`.
@@ -507,7 +507,8 @@ def _get_height(self):
507507
return _size[1] - kb
508508
return _size[0] - kb
509509

510-
height = AliasProperty(_get_height, bind=('_rotation', '_size'))
510+
height = AliasProperty(_get_height,
511+
bind=('_rotation', '_size', '_density'))
511512
'''Rotated window height.
512513
513514
:attr:`height` is a read-only :class:`~kivy.properties.AliasProperty`.
@@ -516,9 +517,7 @@ def _get_height(self):
516517
def _get_center(self):
517518
return self.width / 2., self.height / 2.
518519

519-
center = AliasProperty(_get_center,
520-
bind=('width', 'height', '_density'),
521-
cache=True)
520+
center = AliasProperty(_get_center, bind=('width', 'height'))
522521
'''Center of the rotated window.
523522
524523
.. versionadded:: 1.0.9

0 commit comments

Comments
 (0)