Commit 0b3d5fd8 authored by Christoph Haag's avatar Christoph Haag Committed by Lubosz Sarnecki

window: remove reset_scale parameter, it is always 1.0

parent c65a369b
......@@ -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, NULL, 0);
xrd_window_set_reset_transformation (window, &transform);
if ((col + row) % 2 == 0)
xrd_window_set_flip_y (window, true);
......
......@@ -297,7 +297,6 @@ xrd_overlay_window_init (XrdOverlayWindow *self)
self->window_data.texture_height = 0;
self->window_data.texture = NULL;
self->window_data.selected = FALSE;
self->window_data.reset_scale = 1.0f;
graphene_matrix_init_identity (&self->window_data.reset_transform);
}
......
......@@ -172,7 +172,6 @@ xrd_scene_window_init (XrdSceneWindow *self)
priv->window_data.texture_height = 0;
priv->window_data.texture = NULL;
priv->window_data.selected = FALSE;
priv->window_data.reset_scale = 1.0f;
graphene_matrix_init_identity (&priv->window_data.reset_transform);
}
......
......@@ -2215,8 +2215,7 @@ _save_window_states (XrdClient *self,
state[i].pinned = data->pinned;
xrd_window_get_reset_transformation (window, &state[i].reset_transform,
&state[i].reset_scale);
xrd_window_get_reset_transformation (window, &state[i].reset_transform);
/* Window state is saved in the order windows were added to the client.
* So the reference to a child window is just an index in this array. */
......@@ -2312,8 +2311,7 @@ xrd_client_switch_mode (XrdClient *self)
lookup_keys[i]);
xrd_window_set_transformation (window, &state[i].transform);
xrd_window_set_reset_transformation (window, &state[i].reset_transform,
state[i].reset_scale);
xrd_window_set_reset_transformation (window, &state[i].reset_transform);
xrd_window_set_pin (window, state[i].pinned, show_only_pinned);
}
......
......@@ -176,7 +176,7 @@ xrd_window_manager_arrange_reset (XrdWindowManager *self)
xrd_window_get_transformation_no_scale (window, &transition->from);
transition->to_scaling = data->reset_scale;
transition->to_scaling = 1.0f;
g_object_get (G_OBJECT(window), "scale", &transition->from_scaling, NULL);
......@@ -306,9 +306,7 @@ xrd_window_manager_arrange_sphere (XrdWindowManager *self)
graphene_matrix_init_from_matrix (&transition->to, &transform);
XrdWindowData *data = xrd_window_get_data (window);
transition->to_scaling = data->reset_scale;
transition->to_scaling = 1.0f;
g_timeout_add (20, _interpolate_cb, transition);
}
......
......@@ -672,45 +672,22 @@ xrd_window_get_aspect_ratio (XrdWindow *self)
/**
* xrd_window_set_reset_transformation:
* @self: The #XrdWindow
* @transform: A transformation matrix to save as reset transform, or NULL
* to save the current transform as reset transform.
* @scale: The scale to save with the reset transform. If @transform is NULL,
* this parameter is ignored and the current #XrdWindow scale is saved instead.
* @transform: A transformation matrix to save as reset transform.
*/
void
xrd_window_set_reset_transformation (XrdWindow *self,
graphene_matrix_t *transform,
float scale)
graphene_matrix_t *transform)
{
XrdWindowData *data = xrd_window_get_data (self);
if (transform)
{
data->reset_scale = scale;
graphene_matrix_init_from_matrix (&data->reset_transform, transform);
}
else
{
graphene_matrix_t current_transform;
xrd_window_get_transformation_no_scale (self, &current_transform);
graphene_matrix_init_from_matrix (&data->reset_transform,
&current_transform);
gfloat reset_scale;
g_object_get (self, "scale", &reset_scale, NULL);
data->reset_scale = reset_scale;
}
graphene_matrix_init_from_matrix (&data->reset_transform, transform);
}
void
xrd_window_get_reset_transformation (XrdWindow *self,
graphene_matrix_t *transform,
float *scale)
graphene_matrix_t *transform)
{
XrdWindowData *data = xrd_window_get_data (self);
graphene_matrix_init_from_matrix (transform, &data->reset_transform);
*scale = data->reset_scale;
}
/**
......
......@@ -99,7 +99,6 @@ typedef struct {
uint32_t texture_width;
uint32_t texture_height;
graphene_matrix_t reset_transform;
float reset_scale;
gboolean pinned;
float current_width;
......@@ -156,7 +155,6 @@ typedef struct {
graphene_point_t child_offset_center;
graphene_matrix_t reset_transform;
float reset_scale;
gboolean pinned;
......@@ -381,13 +379,11 @@ xrd_window_set_color (XrdWindow *self, const graphene_vec3_t *color);
void
xrd_window_set_reset_transformation (XrdWindow *self,
graphene_matrix_t *transform,
float scale);
graphene_matrix_t *transform);
void
xrd_window_get_reset_transformation (XrdWindow *self,
graphene_matrix_t *transform,
float *scale);
graphene_matrix_t *transform);
void
xrd_window_set_pin (XrdWindow *self,
......
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