Mercurial > hg > orthanc-stone
diff Framework/Layers/CircleMeasureTracker.cpp @ 365:ef31240a73f6 am-2
no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 31 Oct 2018 18:10:29 +0100 |
parents | 50e5ec1bdd46 |
children | a7de01c8fd29 |
line wrap: on
line diff
--- a/Framework/Layers/CircleMeasureTracker.cpp Wed Oct 31 11:06:25 2018 +0100 +++ b/Framework/Layers/CircleMeasureTracker.cpp Wed Oct 31 18:10:29 2018 +0100 @@ -24,8 +24,6 @@ #include "CircleMeasureTracker.h" -#include "../Viewport/CairoFont.h" - #include <stdio.h> namespace OrthancStone @@ -37,14 +35,14 @@ uint8_t red, uint8_t green, uint8_t blue, - unsigned int fontSize) : + const Orthanc::Font& font) : statusBar_(statusBar), slice_(slice), x1_(x), y1_(y), x2_(x), y2_(y), - fontSize_(fontSize) + font_(font) { color_[0] = red; color_[1] = green; @@ -73,14 +71,8 @@ cairo_stroke(cr); cairo_restore(cr); - if (fontSize_ != 0) - { - cairo_move_to(cr, x, y); -#if ORTHANC_ENABLE_NATIVE==1 // text rendering currently fails in wasm - CairoFont font("sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); - font.Draw(context, FormatRadius(), static_cast<double>(fontSize_) / zoom); -#endif - } + //context.SetSourceColor(0, 255, 0); + context.DrawText(font_, FormatRadius(), x, y); }