Changeset View
Changeset View
Standalone View
Standalone View
src/view/kateviewhelpers.cpp
Show First 20 Lines • Show All 1980 Lines • ▼ Show 20 Line(s) | 1980 | if (mrk && lineLayout.startCol() == 0) { | |||
---|---|---|---|---|---|
1981 | for (uint bit = 0; bit < 32; bit++) { | 1981 | for (uint bit = 0; bit < 32; bit++) { | ||
1982 | MarkInterface::MarkTypes markType = (MarkInterface::MarkTypes)(1 << bit); | 1982 | MarkInterface::MarkTypes markType = (MarkInterface::MarkTypes)(1 << bit); | ||
1983 | if (mrk & markType) { | 1983 | if (mrk & markType) { | ||
1984 | QPixmap px_mark(m_doc->markPixmap(markType)); | 1984 | QPixmap px_mark(m_doc->markPixmap(markType)); | ||
1985 | px_mark.setDevicePixelRatio(devicePixelRatioF()); | 1985 | px_mark.setDevicePixelRatio(devicePixelRatioF()); | ||
1986 | 1986 | | |||
1987 | if (!px_mark.isNull() && h > 0 && m_iconAreaWidth > 0) { | 1987 | if (!px_mark.isNull() && h > 0 && m_iconAreaWidth > 0) { | ||
1988 | // scale up to a usable size | 1988 | // scale up to a usable size | ||
1989 | px_mark = px_mark.scaled(m_iconAreaWidth * devicePixelRatioF(), h * devicePixelRatioF(), Qt::KeepAspectRatio); | 1989 | const int s = qMin(m_iconAreaWidth * devicePixelRatioF(), h * devicePixelRatioF()) - 2; | ||
1990 | px_mark = px_mark.scaled(s, s, Qt::KeepAspectRatio); | ||||
1990 | 1991 | | |||
1991 | // center the mark pixmap | 1992 | // center the mark pixmap | ||
1992 | int x_px = 0.5 * qMax(m_iconAreaWidth - (px_mark.width() / devicePixelRatioF()), 0.0); | 1993 | int x_px = 0.5 * qMax(m_iconAreaWidth - (s / devicePixelRatioF()), 0.0); | ||
1993 | int y_px = 0.5 * qMax(h - (px_mark.height() / devicePixelRatioF()), 0.0); | 1994 | int y_px = 0.5 * qMax(h - (s / devicePixelRatioF()), 0.0); | ||
1994 | 1995 | | |||
1995 | p.drawPixmap(lnX + x_px, y + y_px, px_mark); | 1996 | p.drawPixmap(lnX + x_px, y + y_px, px_mark); | ||
1996 | } | 1997 | } | ||
1997 | } | 1998 | } | ||
1998 | } | 1999 | } | ||
1999 | } | 2000 | } | ||
2000 | 2001 | | |||
2001 | lnX += m_iconAreaWidth + m_separatorWidth; | 2002 | lnX += m_iconAreaWidth + m_separatorWidth; | ||
▲ Show 20 Lines • Show All 1093 Lines • Show Last 20 Lines |