Typed text drawn as its pixels; effects kept while typing, painting masks and undoing (12.12a)
This commit is contained in:
1 parent
8fbb104c48
commit
136ee65a48
23 files changed
+1125
-153
No files matched your search
@@ -229,3 +229,16 @@ bool CanvasView::brushBracket(const QString &text)
|
||||
m_session.changeBrushHardness(text == u"}");
|
||||
return true;
|
||||
}
|
||||
|
||||
// The stroke's dirty rect in view points, two points out.
|
||||
std::optional<QRectF> CanvasView::strokeDirtyRect() const
|
||||
{
|
||||
const BrushStroke *stroke = m_session.brushStroke();
|
||||
const std::optional<CanvasDocument> &document = m_session.document();
|
||||
if (!stroke || !document || !stroke->dirtyDocumentRect())
|
||||
return std::nullopt;
|
||||
const QRectF &dirty = *stroke->dirtyDocumentRect();
|
||||
const QPointF origin = m_session.viewport.viewPoint(dirty.topLeft(), document->size());
|
||||
const double scale = m_session.viewport.pointsPerPixel();
|
||||
return QRectF(origin, QSizeF(dirty.width() * scale, dirty.height() * scale)).adjusted(-2, -2, 2, 2);
|
||||
}
|
||||
Reference in new issue
Block a user