From bf825f8ebd18615fdbecb449c14300105d469a24 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Wed, 30 Nov 2022 22:40:52 +0100 Subject: Add a unit test for drawing complex shapes (#565) --- FL/Fl_Graphics_Driver.H | 2 ++ FL/fl_draw.H | 13 +++++++++++++ 2 files changed, 15 insertions(+) (limited to 'FL') diff --git a/FL/Fl_Graphics_Driver.H b/FL/Fl_Graphics_Driver.H index 817fcd9ea..006721f61 100644 --- a/FL/Fl_Graphics_Driver.H +++ b/FL/Fl_Graphics_Driver.H @@ -234,6 +234,8 @@ public: // support of "complex shapes" void push_matrix(); void pop_matrix(); + void load_identity(); + void load_matrix(double a, double b, double c, double d, double x, double y); void mult_matrix(double a, double b, double c, double d, double x, double y); void rotate(double d); void translate(double x,double y); diff --git a/FL/fl_draw.H b/FL/fl_draw.H index fc3e401ca..33c1f716f 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -550,6 +550,19 @@ inline void fl_translate(double x, double y) { inline void fl_rotate(double d) { fl_graphics_driver->rotate(d); } +/** + Set the transformation matrix to identity. + */ +inline void fl_load_identity() { + fl_graphics_driver->load_identity(); +} +/** + Set the current transformation matrix. + \param[in] a,b,c,d,x,y transformation matrix elements + */ +inline void fl_load_matrix(double a, double b, double c, double d, double x, double y) { + fl_graphics_driver->load_matrix(a, b, c, d, x, y); +} /** Concatenate another transformation onto the current one. -- cgit v1.2.3