[gtk] colorscale: Remove x/y arguments from snapshot_scale
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] colorscale: Remove x/y arguments from snapshot_scale
- Date: Sun, 11 Nov 2018 10:23:40 +0000 (UTC)
commit 6eba544ad46ffccb99e42cad0d9b6dd78b5ca537
Author: Timm Bäder <mail baedert org>
Date: Fri Nov 9 18:01:26 2018 +0100
colorscale: Remove x/y arguments from snapshot_scale
We only pass 0 anyway.
gtk/gtkcolorscale.c | 17 +++++++----------
gtk/gtkcolorscaleprivate.h | 2 --
gtk/gtkrange.c | 1 -
3 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkcolorscale.c b/gtk/gtkcolorscale.c
index 16034ae984..a606e048a9 100644
--- a/gtk/gtkcolorscale.c
+++ b/gtk/gtkcolorscale.c
@@ -54,8 +54,6 @@ G_DEFINE_TYPE_WITH_PRIVATE (GtkColorScale, gtk_color_scale, GTK_TYPE_SCALE)
void
gtk_color_scale_snapshot_trough (GtkColorScale *scale,
GtkSnapshot *snapshot,
- int x,
- int y,
int width,
int height)
{
@@ -102,7 +100,7 @@ gtk_color_scale_snapshot_trough (GtkColorScale *scale,
gtk_snapshot_append_texture (snapshot,
texture,
- &GRAPHENE_RECT_INIT(x, y, width, height));
+ &GRAPHENE_RECT_INIT(0, 0, width, height));
g_object_unref (texture);
}
else if (priv->type == GTK_COLOR_SCALE_ALPHA)
@@ -111,21 +109,20 @@ gtk_color_scale_snapshot_trough (GtkColorScale *scale,
graphene_point_t start, end;
cr = gtk_snapshot_append_cairo (snapshot,
- &GRAPHENE_RECT_INIT(x, y, width, height));
- cairo_translate (cr, x, y);
+ &GRAPHENE_RECT_INIT(0, 0, width, height));
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)) == GTK_ORIENTATION_HORIZONTAL &&
gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
{
cairo_translate (cr, width, 0);
cairo_scale (cr, -1, 1);
- graphene_point_init (&start, x + width, y);
- graphene_point_init (&end, x, y);
+ graphene_point_init (&start, width, 0);
+ graphene_point_init (&end, 0, 0);
}
else
{
- graphene_point_init (&start, x, y);
- graphene_point_init (&end, x + width, y);
+ graphene_point_init (&start, 0, 0);
+ graphene_point_init (&end, width, 0);
}
cairo_pattern_t *pattern;
@@ -147,7 +144,7 @@ gtk_color_scale_snapshot_trough (GtkColorScale *scale,
color = &priv->color;
gtk_snapshot_append_linear_gradient (snapshot,
- &GRAPHENE_RECT_INIT(x, y, width, height),
+ &GRAPHENE_RECT_INIT(0, 0, width, height),
&start,
&end,
(GskColorStop[2]) {
diff --git a/gtk/gtkcolorscaleprivate.h b/gtk/gtkcolorscaleprivate.h
index f87a40221e..d8ced03da6 100644
--- a/gtk/gtkcolorscaleprivate.h
+++ b/gtk/gtkcolorscaleprivate.h
@@ -63,8 +63,6 @@ void gtk_color_scale_set_rgba (GtkColorScale *scale,
void gtk_color_scale_snapshot_trough (GtkColorScale *scale,
GtkSnapshot *snapshot,
- int x,
- int y,
int width,
int height);
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index db97df7317..3a44685b6d 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -1670,7 +1670,6 @@ gtk_range_render_trough (GtkGizmo *gizmo,
*/
if (GTK_IS_COLOR_SCALE (widget))
gtk_color_scale_snapshot_trough (GTK_COLOR_SCALE (widget), snapshot,
- 0, 0,
gtk_widget_get_width (GTK_WIDGET (gizmo)),
gtk_widget_get_height (GTK_WIDGET (gizmo)));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]