Changeset View
Changeset View
Standalone View
Standalone View
krita/ui/widgets/kis_scratch_pad.cpp
Show First 20 Lines • Show All 301 Lines • ▼ Show 20 Line(s) | 291 | void KisScratchPad::paintEvent ( QPaintEvent * event ) { | |||
---|---|---|---|---|---|
302 | m_paintLayer->projectionPlane()->recalculate(alignedImageRect, m_paintLayer); | 302 | m_paintLayer->projectionPlane()->recalculate(alignedImageRect, m_paintLayer); | ||
303 | KisPaintDeviceSP projection = m_paintLayer->projection(); | 303 | KisPaintDeviceSP projection = m_paintLayer->projection(); | ||
304 | 304 | | |||
305 | QImage image = projection->convertToQImage(m_displayProfile, | 305 | QImage image = projection->convertToQImage(m_displayProfile, | ||
306 | alignedImageRect.x(), | 306 | alignedImageRect.x(), | ||
307 | alignedImageRect.y(), | 307 | alignedImageRect.y(), | ||
308 | alignedImageRect.width(), | 308 | alignedImageRect.width(), | ||
309 | alignedImageRect.height(), | 309 | alignedImageRect.height(), | ||
310 | KoColorConversionTransformation::InternalRenderingIntent, | 310 | KoColorConversionTransformation::internalRenderingIntent(), | ||
311 | KoColorConversionTransformation::InternalConversionFlags); | 311 | KoColorConversionTransformation::internalConversionFlags()); | ||
312 | 312 | | |||
313 | QPainter gc(this); | 313 | QPainter gc(this); | ||
314 | gc.fillRect(event->rect(), m_checkBrush); | 314 | gc.fillRect(event->rect(), m_checkBrush); | ||
315 | 315 | | |||
316 | gc.setRenderHints(QPainter::SmoothPixmapTransform); | 316 | gc.setRenderHints(QPainter::SmoothPixmapTransform); | ||
317 | gc.drawImage(QRectF(event->rect()), image, imageRect.translated(-offset)); | 317 | gc.drawImage(QRectF(event->rect()), image, imageRect.translated(-offset)); | ||
318 | 318 | | |||
319 | QBrush brush(Qt::lightGray); | 319 | QBrush brush(Qt::lightGray); | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
362 | } | 362 | } | ||
363 | 363 | | |||
364 | QImage KisScratchPad::cutoutOverlay() const | 364 | QImage KisScratchPad::cutoutOverlay() const | ||
365 | { | 365 | { | ||
366 | if(!m_paintLayer) return QImage(); | 366 | if(!m_paintLayer) return QImage(); | ||
367 | KisPaintDeviceSP paintDevice = m_paintLayer->paintDevice(); | 367 | KisPaintDeviceSP paintDevice = m_paintLayer->paintDevice(); | ||
368 | 368 | | |||
369 | QRect rc = widgetToDocument().mapRect(m_cutoutOverlay); | 369 | QRect rc = widgetToDocument().mapRect(m_cutoutOverlay); | ||
370 | QImage rawImage = paintDevice->convertToQImage(0, rc.x(), rc.y(), rc.width(), rc.height(), KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags); | 370 | QImage rawImage = paintDevice->convertToQImage(0, rc.x(), rc.y(), rc.width(), rc.height(), KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::internalConversionFlags()); | ||
371 | 371 | | |||
372 | QImage scaledImage = rawImage.scaled(m_cutoutOverlay.size(), | 372 | QImage scaledImage = rawImage.scaled(m_cutoutOverlay.size(), | ||
373 | Qt::IgnoreAspectRatio, | 373 | Qt::IgnoreAspectRatio, | ||
374 | Qt::SmoothTransformation); | 374 | Qt::SmoothTransformation); | ||
375 | 375 | | |||
376 | return scaledImage; | 376 | return scaledImage; | ||
377 | } | 377 | } | ||
378 | 378 | | |||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |