Turn off anti-aliasing when drawing the selection rects

This commit is contained in:
Kovid Goyal 2013-12-03 21:51:02 +05:30
parent 996a338ed0
commit 621a81f865

View File

@ -264,6 +264,7 @@ class Canvas(QWidget):
def draw_selection_rect(self, painter): def draw_selection_rect(self, painter):
cr, sr = self.target, self.selection_state.rect cr, sr = self.target, self.selection_state.rect
painter.setPen(self.SELECT_PEN) painter.setPen(self.SELECT_PEN)
painter.setRenderHint(QPainter.Antialiasing, False)
if self.selection_state.current_mode == 'selected': if self.selection_state.current_mode == 'selected':
# Shade out areas outside the selection rect # Shade out areas outside the selection rect
for r in ( for r in (
@ -279,7 +280,7 @@ class Canvas(QWidget):
# Draw the resize rectangle # Draw the resize rectangle
painter.save() painter.save()
painter.setCompositionMode(QPainter.RasterOp_SourceAndNotDestination) painter.setCompositionMode(QPainter.RasterOp_SourceAndNotDestination)
painter.setClipRect(sr) painter.setClipRect(sr.adjusted(1, 1, -1, -1))
painter.drawRect(dr) painter.drawRect(dr)
painter.restore() painter.restore()