Commit 30930287 authored by Christoph Haag's avatar Christoph Haag Committed by Lubosz Sarnecki

window: Bring back save_reset_transformation

It saves the current transformation as the reset transformation.
parent 0b3d5fd8
......@@ -348,7 +348,7 @@ _init_windows (Example *self)
graphene_matrix_init_translate (&transform, &point);
xrd_window_set_transformation (window, &transform);
xrd_window_set_reset_transformation (window, &transform);
xrd_window_save_reset_transformation (window);
if ((col + row) % 2 == 0)
xrd_window_set_flip_y (window, true);
......
......@@ -669,6 +669,21 @@ xrd_window_get_aspect_ratio (XrdWindow *self)
return (float) w / (float) h;
}
/**
* xrd_window_save_reset_transformation:
* @self: The #XrdWindow
* Saves the current transformation as the reset transformation.
*/
void
xrd_window_save_reset_transformation (XrdWindow *self)
{
XrdWindowData *data = xrd_window_get_data (self);
graphene_matrix_t current_transform;
xrd_window_get_transformation_no_scale (self, &current_transform);
graphene_matrix_init_from_matrix (&data->reset_transform,
&current_transform);
}
/**
* xrd_window_set_reset_transformation:
* @self: The #XrdWindow
......
......@@ -377,6 +377,9 @@ xrd_window_get_aspect_ratio (XrdWindow *self);
void
xrd_window_set_color (XrdWindow *self, const graphene_vec3_t *color);
void
xrd_window_save_reset_transformation (XrdWindow *self);
void
xrd_window_set_reset_transformation (XrdWindow *self,
graphene_matrix_t *transform);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment