|
Scroom 0.14-48-ga0fee447
|
#include <rulerstrategies.hh>


Public Member Functions | |
| double | getMajorTickLength (double percentage) override |
| double | getDrawAreaSize () override |
| void | drawOutline (cairo_t *cr, double lineWidth) override |
| void | drawTickLine (cairo_t *cr, double linePosition, double lineWidth, double lineLength) override |
| void | drawTickText (cairo_t *cr, const std::string &label, double linePosition, double labelOffset, double labelAlign, double lineLength) override |
Public Member Functions inherited from RulerDrawStrategy | |
| void | setAllocatedSize (int newWidth, int height) |
| int | getWidth () const |
| int | getHeight () const |
Static Public Member Functions | |
| static RulerDrawStrategy::Ptr | create () |
Additional Inherited Members | |
Public Types inherited from RulerDrawStrategy | |
| using | Ptr = std::shared_ptr< RulerDrawStrategy > |
Static Protected Attributes inherited from RulerDrawStrategy | |
| static constexpr double | LINE_COORD_OFFSET {0.5} |
| static constexpr double | TEXT_ANCHOR {0.5} |
This class implements the drawing code for a vertical ruler.
|
static |
Creates a new VerticalDrawStrategy.
Referenced by Ruler::create().

|
overridevirtual |
Draws the outline around the ruler.
| cr | Cairo context to draw to. |
| lineWidth | Width of the outline in pixels. |
Implements RulerDrawStrategy.

|
overridevirtual |
Draws the line for a ruler tick.
| cr | Cairo context to draw to. |
| linePosition | Position of the line along the ruler in pixels. |
| lineWidth | Width of the tick line in pixels. |
| lineLength | Length of the tick line in pixels. |
| width | Allocated width for the ruler in pixels. |
| height | Allocated height for the ruler in pixels. |
Implements RulerDrawStrategy.

|
overridevirtual |
Draws the label to the right of a tick line.
| cr | Cairo context to draw to. |
| label | Text to draw to right of tick line. |
| linePosition | Position of the line along the ruler in pixels. |
| labelOffset | Offset between tick line and label in pixels. |
| labelAlign | Alignment of label along tick line as a fraction of line length. |
| lineLength | Length of the tick line in pixels. |
| width | Allocated width for the ruler in pixels. |
| height | Allocated height for the ruler in pixels. |
Implements RulerDrawStrategy.

|
overridevirtual |
Returns the length in pixels along the ruler. For a horizontal ruler, this is its width. For a vertical ruler, this is its height.
| width | Allocated width for the ruler in pixels. |
| height | Allocated height for the ruler in pixels. |
Implements RulerDrawStrategy.

|
overridevirtual |
Returns the length of the major tick lines, given the ruler dimensions.
| width | Allocated width for the ruler in pixels. |
| height | Allocated height for the ruler in pixels. |
| percentage | Percentage of the /p width or /p height to be the length of the major ticks. |
Implements RulerDrawStrategy.
