MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / paintBlock

Method paintBlock

src/plugins/git/gui/gitdiffwidget.cpp:213–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void GitDiffEditor::paintBlock(const QRect &eventRect) const
214{
215 QPainter painter(viewport());
216 auto offset = contentOffset();
217 painter.setBrushOrigin(offset);
218
219 QTextBlock block = firstVisibleBlock();
220 while (block.isValid()) {
221 PaintEventBlockData blockData;
222 blockData.boundingRect = blockBoundingRect(block).translated(offset);
223
224 if (blockData.boundingRect.bottom() >= eventRect.top()
225 && blockData.boundingRect.top() <= eventRect.bottom()) {
226 blockData.position = block.position();
227 blockData.length = block.length();
228
229 paintBlock(&painter, block, offset, blockData.selections, eventRect);
230 }
231
232 offset.ry() += blockData.boundingRect.height();
233 if (offset.y() > viewport()->rect().height())
234 break;
235
236 block = block.next();
237 }
238}
239
240void GitDiffEditor::paintBlock(QPainter *painter,
241 const QTextBlock &block,

Callers

nothing calls this directly

Calls 10

bottomMethod · 0.80
topMethod · 0.80
isValidMethod · 0.45
lengthMethod · 0.45
nextMethod · 0.45
valueMethod · 0.45
countMethod · 0.45
textMethod · 0.45
setPropertyMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected