Changeset View
Changeset View
Standalone View
Standalone View
lib/documentview/svgviewadapter.cpp
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Line(s) | 121 | case AbstractImageView::AlphaBackgroundCheckBoard: { | |||
---|---|---|---|---|---|
125 | p.drawTiledPixmap(background.rect(), texture, textureOffset); | 125 | p.drawTiledPixmap(background.rect(), texture, textureOffset); | ||
126 | painter->drawPixmap(imageRect.topLeft(), background); | 126 | painter->drawPixmap(imageRect.topLeft(), background); | ||
127 | break; | 127 | break; | ||
128 | } | 128 | } | ||
129 | case AbstractImageView::AlphaBackgroundSolid: { | 129 | case AbstractImageView::AlphaBackgroundSolid: { | ||
130 | painter->fillRect(imageRect, mAlphaBackgroundColor); | 130 | painter->fillRect(imageRect, mAlphaBackgroundColor); | ||
131 | break; | 131 | break; | ||
132 | } | 132 | } | ||
133 | case AbstractImageView::AlphaBackgroundNone: { | ||||
134 | // Unlike RasterImageView, SVGs are rendered directly on the image view, | ||||
135 | // therefore we can simply not draw a background | ||||
136 | } | ||||
133 | default: { | 137 | default: { | ||
134 | // Should never reach here because we cover all enum options | 138 | // Should never reach here because we cover all enum options | ||
135 | } | 139 | } | ||
136 | } | 140 | } | ||
137 | } | 141 | } | ||
138 | 142 | | |||
139 | void SvgImageView::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget* /*widget*/) | 143 | void SvgImageView::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget* /*widget*/) | ||
140 | { | 144 | { | ||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |