#include <canvas_private.hpp>
Public Member Functions | |
line_shape (const config &cfg) | |
Constructor. More... | |
void | draw (wfl::map_formula_callable &variables) override |
Draws the canvas. More... | |
Public Member Functions inherited from gui2::canvas::shape | |
shape (const config &cfg) | |
virtual | ~shape () |
bool | immutable () const |
Private Attributes | |
typed_formula< unsigned > | x1_ |
The start x coordinate of the line. More... | |
typed_formula< unsigned > | y1_ |
The start y coordinate of the line. More... | |
typed_formula< unsigned > | x2_ |
The end x coordinate of the line. More... | |
typed_formula< unsigned > | y2_ |
The end y coordinate of the line. More... | |
typed_formula< color_t > | color_ |
The color of the line. More... | |
unsigned | thickness_ |
The thickness of the line. More... | |
Definition at line 22 of file canvas_private.hpp.
|
explicit |
Constructor.
cfg | The config object to define the line. |
Definition at line 51 of file canvas.cpp.
|
overridevirtual |
Draws the canvas.
variables | The canvas can have formulas in it's definition, this parameter contains the values for these formulas. |
Implements gui2::canvas::shape.
Definition at line 66 of file canvas.cpp.
References color_, DBG_GUI_D, draw::line(), x1_, x2_, y1_, and y2_.
|
private |
|
private |
The thickness of the line.
if the value is odd the x and y are the middle of the line. if the value is even the x and y are the middle of a line with width - 1. (0 is special case, does nothing.)
Definition at line 50 of file canvas_private.hpp.
|
private |
The start x coordinate of the line.
Definition at line 35 of file canvas_private.hpp.
Referenced by draw().
|
private |
The end x coordinate of the line.
Definition at line 37 of file canvas_private.hpp.
Referenced by draw().
|
private |
The start y coordinate of the line.
Definition at line 36 of file canvas_private.hpp.
Referenced by draw().
|
private |
The end y coordinate of the line.
Definition at line 38 of file canvas_private.hpp.
Referenced by draw().