Skip to content

Commit

Permalink
Ensure textual backend does scaling on screen sizes.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Feb 11, 2024
1 parent 35f0847 commit 777f272
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions textual/src/toga_textual/screens.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from toga.screens import Screen as ScreenInterface

from .widgets.base import Scalable

class Screen:

class Screen(Scalable):
_instances = {}

def __new__(cls, native):
Expand All @@ -21,7 +23,10 @@ def get_origin(self):
return (0, 0)

def get_size(self):
return (self.native.size.width, self.native.size.height)
return (
self.scale_out_horizontal(self.native.size.width),
self.scale_out_vertical(self.native.size.height),
)

def get_image_data(self):
self.interface.factory.not_implemented("Screen.get_image_data()")

0 comments on commit 777f272

Please sign in to comment.