Skip to content

Commit

Permalink
Support retina
Browse files Browse the repository at this point in the history
  • Loading branch information
mumu-lhl committed Oct 17, 2023
1 parent dfdc53a commit 478bb60
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions eaf_pyqterm_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def __init__(self):
self.backend = backend.Backend(self.columns, self.rows)

self.pixmap = QPixmap(self.width(), self.height())
self.pixmap.setDevicePixelRatio(1)

self.startTimer(self.refresh_ms)

Expand Down Expand Up @@ -555,9 +556,12 @@ def get_cursor_absolute_position(self) -> (int, int):
def resize_view(self):
width = self.width()
height = self.height()

self.columns, self.rows = self.pixel_to_position(width, height)
self.backend.resize(self.columns, self.rows)

self.pixmap = QPixmap(width, height)
self.pixmap.setDevicePixelRatio(1)
self.paint_pixmap()

def paintEvent(self, _):
Expand Down

0 comments on commit 478bb60

Please sign in to comment.