MCPcopy Create free account
hub / github.com/IgKh/katvan / blockBoundingRect

Method blockBoundingRect

core/katvan_editorlayout.cpp:145–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145QRectF EditorLayout::blockBoundingRect(const QTextBlock& block) const
146{
147 if (!block.isValid() || !document()->isLayoutEnabled()) {
148 return QRectF();
149 }
150
151 auto* layoutData = BlockData::get<LayoutBlockData>(block);
152 if (layoutData == nullptr) {
153 return QRectF();
154 }
155
156 QTextLayout* layout = layoutData->displayLayout
157 ? layoutData->displayLayout.get()
158 : block.layout();
159
160 if (layout->lineCount() == 0) {
161 return QRectF();
162 }
163
164 QRectF rect = layout->boundingRect();
165 rect.moveTopLeft(layout->position());
166 return rect;
167}
168
169int EditorLayout::hitTest(const QPointF& point, Qt::HitTestAccuracy accuracy) const
170{

Callers 1

Calls 2

getMethod · 0.80
positionMethod · 0.80

Tested by

no test coverage detected