mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Profile: add white outline to all text
To draw the white outline around profile text we trace a text path using QPainterPath::addText() and then create a couple of QGraphicsPathItem objects. One of the objects is outlined using QPainterPathStroker and is placed at the bottom of a QGraphicsItemGroup with a white brush. The other object holds the standard colored text and is placed on top. Notes: - possibly quite expensive on older machines - ProfileGraphicsView::plot_text() now returns a QGraphicsItemGroup - QGraphicsSimpleTextItem uses a top-left baseline anchor while QPainterPath::addText() uses a bottom-left baseline which is a bit mysterious, requires the -3 offset for a match and is possibly non-portable across fonts and sizes. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9d9d516c26
commit
b68e86a141
2 changed files with 23 additions and 10 deletions
|
@ -104,7 +104,7 @@ public slots:
|
|||
|
||||
private:
|
||||
void plot_depth_profile();
|
||||
QGraphicsSimpleTextItem* plot_text(text_render_options_t *tro, const QPointF& pos, const QString &text, QGraphicsItem *parent = 0);
|
||||
QGraphicsItemGroup *plot_text(text_render_options_t *tro, const QPointF& pos, const QString &text, QGraphicsItem *parent = 0);
|
||||
void plot_events(struct divecomputer *dc);
|
||||
void plot_one_event(struct event *event);
|
||||
void plot_temperature_profile();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue