mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor(text): Add early break
This commit is contained in:
parent
c8512fa984
commit
c3bf4b7085
|
@ -150,8 +150,10 @@ QRectF Text::boundingRect() const
|
|||
|
||||
void Text::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
|
||||
{
|
||||
if (doc)
|
||||
{
|
||||
|
||||
if (!doc)
|
||||
return;
|
||||
|
||||
painter->setClipRect(boundingRect());
|
||||
|
||||
// draw selection
|
||||
|
@ -175,10 +177,6 @@ void Text::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWid
|
|||
doc->documentLayout()->draw(painter, ctx);
|
||||
}
|
||||
|
||||
Q_UNUSED(option)
|
||||
Q_UNUSED(widget)
|
||||
}
|
||||
|
||||
void Text::visibilityChanged(bool visible)
|
||||
{
|
||||
keepInMemory = visible;
|
||||
|
|
Loading…
Reference in New Issue
Block a user