5#include <fifechan/widgets/linegraph.hpp>
7#include <fifechan/exception.hpp>
8#include <fifechan/graphics.hpp>
61 ((
getSelectionMode() & Widget::SelectionMode::Background) == Widget::SelectionMode::Background)) {
74 if (active && (
getSelectionMode() & Widget::SelectionMode::Border) == Widget::SelectionMode::Border) {
94 for (; pit !=
m_data.end(); ++pit) {
95 int const x2 = (*pit).x;
96 int const y2 = (*pit).y;
102 for (; pit !=
m_data.end(); ++pit) {
103 int const x2 = (*pit).x;
104 int const y2 = (*pit).y;
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
virtual void drawLine(int x1, int y1, int x2, int y2)=0
Draws a line.
virtual void setColor(Color const &color)=0
Sets the color to use when drawing.
virtual void fillRectangle(Rectangle const &rectangle)=0
Draws a filled rectangle.
virtual void drawRoundStroke(int x1, int y1, int x2, int y2, unsigned int width)
Draws a round brush stroke along the line segment.
LineGraph()
Default constructor.
bool m_opaque
True if the graph is drawn opaque.
PointVector const & getPointVector() const
Get the current point vector.
void setPointVector(PointVector const &data)
Set the raw point vector used to draw the graph.
void draw(Graphics *graphics) override
Draws this widget.
void resetPointVector()
Reset the stored data to an empty vector.
PointVector m_data
The point data used to draw the graph.
unsigned int m_thickness
Stroke thickness in pixels.
void setOpaque(bool opaque)
Sets the opacity of the graph.
unsigned int getThickness() const
Get stroke thickness in pixels.
void setThickness(unsigned int thickness)
Set stroke thickness in pixels.