Skip to content

Commit

Permalink
Merge from 3.x: PR #4738
Browse files Browse the repository at this point in the history
Fixes #4734
  • Loading branch information
ccordoba12 committed Jul 26, 2017
2 parents 9a89f78 + be0568a commit 48e7280
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion spyder/widgets/panels/linenumber.py
Expand Up @@ -8,13 +8,19 @@
"""
import sys

from qtpy import QT_VERSION
from qtpy.QtCore import QSize, Qt
from qtpy.QtGui import QPainter, QColor

from spyder.py3compat import to_text_string
from spyder.utils import icon_manager as ima
from spyder.utils.programs import check_version
from spyder.api.panel import Panel


QT55_VERSION = check_version(QT_VERSION, "5.5", ">=")


class LineNumberArea(Panel):
"""Line number area (on the left side of the text editor widget)"""

Expand Down Expand Up @@ -67,7 +73,12 @@ def paintEvent(self, event):
active_line_number = active_block.blockNumber() + 1

def draw_pixmap(ytop, pixmap):
painter.drawPixmap(0, ytop + (font_height-pixmap.height()) / 2,
if not QT55_VERSION:
pixmap_height = pixmap.height()
else:
# scale pixmap height to device independent pixels
pixmap_height = pixmap.height() / pixmap.devicePixelRatio()
painter.drawPixmap(0, ytop + (font_height-pixmap_height) / 2,
pixmap)

for top, line_number, block in self.editor.visible_blocks:
Expand Down

0 comments on commit 48e7280

Please sign in to comment.