MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / draw

Method draw

src/openms_gui/source/VISUAL/ANNOTATION/Annotation1DTextItem.cpp:24–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 }
23
24 void Annotation1DTextItem::draw(Plot1DCanvas* const canvas, QPainter& painter, bool flipped)
25 {
26 // translate units to pixel coordinates
27 QPoint pos_text;
28 canvas->dataToWidget(position_, pos_text, flipped);
29
30 // compute bounding box of text_item on the specified painter
31 bounding_box_ = painter.boundingRect(QRectF(pos_text, pos_text), flags_, text_);
32
33 painter.drawText(bounding_box_, flags_, text_);
34 if (selected_)
35 {
36 drawBoundingBox_(painter);
37 }
38 }
39
40 void Annotation1DTextItem::move(const PointXYType delta, const Gravitator& /*gr*/, const DimMapper<2>& /*dim_mapper*/)
41 {

Callers 3

drawAnnotations_Method · 0.45
paintMethod · 0.45

Calls 4

dataToWidgetMethod · 0.80
drawTextMethod · 0.80
QRectFClass · 0.50
boundingRectMethod · 0.45

Tested by

no test coverage detected