diff --git a/CHANGES.txt b/CHANGES.txt index 7eb6c83bc..1e3e9981a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,18 @@ Enable CHANGELOG ================ +Enable 5.1.1 +============ + +Thanks to: + +* Kit Yan Choi + +Fixes +----- + +* Fix artefact in Qt caused by a wrong QRectF size. (#820) + Enable 5.0.0 ============ diff --git a/enable/qt4/cairo.py b/enable/qt4/cairo.py index 79dbe611b..c5e275a7a 100644 --- a/enable/qt4/cairo.py +++ b/enable/qt4/cairo.py @@ -36,6 +36,8 @@ def _window_paint(self, event): image = QtGui.QImage(data, w, h, QtGui.QImage.Format_ARGB32) - rect = QtCore.QRectF(0, 0, self.control.width(), self.control.height()) + rect = QtCore.QRectF( + 0, 0, w / self._gc.base_scale, h / self._gc.base_scale + ) painter = QtGui.QPainter(self.control) painter.drawImage(rect, image) diff --git a/enable/qt4/celiagg.py b/enable/qt4/celiagg.py index 73fc90575..ae124b03e 100644 --- a/enable/qt4/celiagg.py +++ b/enable/qt4/celiagg.py @@ -48,7 +48,9 @@ def _window_paint(self, event): image = QtGui.QImage( self._shuffle_buffer, w, h, QtGui.QImage.Format_RGB32 ) - rect = QtCore.QRectF(0, 0, self.control.width(), self.control.height()) + rect = QtCore.QRectF( + 0, 0, w / self._gc.base_scale, h / self._gc.base_scale + ) painter = QtGui.QPainter(self.control) painter.drawImage(rect, image) diff --git a/enable/qt4/image.py b/enable/qt4/image.py index 3671e54ca..3f8a8145e 100644 --- a/enable/qt4/image.py +++ b/enable/qt4/image.py @@ -38,7 +38,9 @@ def _window_paint(self, event): h = self._gc.height() data = self._gc.pixel_map.convert_to_argb32string() image = QtGui.QImage(data, w, h, QtGui.QImage.Format_ARGB32) - rect = QtCore.QRectF(0, 0, self.control.width(), self.control.height()) + rect = QtCore.QRectF( + 0, 0, w / self._gc.base_scale, h / self._gc.base_scale + ) painter = QtGui.QPainter(self.control) painter.drawImage(rect, image) diff --git a/kiva/cairo.py b/kiva/cairo.py index 35a41656a..144da687f 100644 --- a/kiva/cairo.py +++ b/kiva/cairo.py @@ -224,8 +224,8 @@ def __init__(self, size, *args, **kw): ctx.scale(1, -1) # For HiDPI support - base_scale = kw.pop("base_pixel_scale", 1) - ctx.scale(base_scale, base_scale) + self.base_scale = kw.pop("base_pixel_scale", 1) + ctx.scale(self.base_scale, self.base_scale) self._ctx = ctx self.state = GraphicsState()