Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Scene2D/CairoCompositor.h @ 1576:92fca2b3ba3d
sanitizing the handling of canvas size
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 24 Sep 2020 16:40:30 +0200 |
parents | 244ad1e4e76a |
children | 8563ea5d8ae4 |
comparison
equal
deleted
inserted
replaced
1575:e4a52cbbdd70 | 1576:92fca2b3ba3d |
---|---|
57 const CairoSurface& GetCanvas() const | 57 const CairoSurface& GetCanvas() const |
58 { | 58 { |
59 return canvas_; | 59 return canvas_; |
60 } | 60 } |
61 | 61 |
62 virtual void RefreshCanvasSize() ORTHANC_OVERRIDE | 62 virtual void SetCanvasSize(unsigned int canvasWidth, |
63 { | 63 unsigned int canvasHeight) ORTHANC_OVERRIDE; |
64 // The canvas size is constant in Cairo, except if | |
65 // "UpdateSize()" is called | |
66 } | |
67 | 64 |
68 virtual unsigned int GetCanvasWidth() const ORTHANC_OVERRIDE | 65 virtual unsigned int GetCanvasWidth() const ORTHANC_OVERRIDE |
69 { | 66 { |
70 return canvas_.GetWidth(); | 67 return canvas_.GetWidth(); |
71 } | 68 } |
90 virtual void ResetScene() ORTHANC_OVERRIDE | 87 virtual void ResetScene() ORTHANC_OVERRIDE |
91 { | 88 { |
92 helper_.reset(new Internals::CompositorHelper(*this)); | 89 helper_.reset(new Internals::CompositorHelper(*this)); |
93 } | 90 } |
94 | 91 |
95 void UpdateSize(unsigned int canvasWidth, | |
96 unsigned int canvasHeight); | |
97 | |
98 Orthanc::ImageAccessor* RenderText(size_t fontIndex, | 92 Orthanc::ImageAccessor* RenderText(size_t fontIndex, |
99 const std::string& utf8) const; | 93 const std::string& utf8) const; |
100 }; | 94 }; |
101 } | 95 } |