diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-01-24 22:46:01 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-01-24 22:49:08 -0500 |
commit | 344f9fcf0584290c622cacb310cd2f7b1567a538 (patch) | |
tree | 1f3e951c0608fa01133aa7eb9277571d3b6f26e6 /gtk/gtkcssstylepropertyimpl.c | |
parent | 4c971cd4da925d8cac0286366d5b22204ee91a55 (diff) | |
download | gtk+-344f9fcf0584290c622cacb310cd2f7b1567a538.tar.gz |
css: Implement transform-origin
Implement most of transform-origin. We only
handle the xy components currently, which lets
us reuse the position value implementation that
is used for background-position.
Diffstat (limited to 'gtk/gtkcssstylepropertyimpl.c')
-rw-r--r-- | gtk/gtkcssstylepropertyimpl.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c index de7f2e3762..3eb4ac7c5c 100644 --- a/gtk/gtkcssstylepropertyimpl.c +++ b/gtk/gtkcssstylepropertyimpl.c @@ -790,6 +790,13 @@ background_position_parse (GtkCssStyleProperty *property, return _gtk_css_array_value_parse (parser, _gtk_css_position_value_parse); } +static GtkCssValue * +transform_origin_parse (GtkCssStyleProperty *property, + GtkCssParser *parser) +{ + return _gtk_css_position_value_parse (parser); +} + /*** REGISTRATION ***/ G_STATIC_ASSERT (GTK_CSS_PROPERTY_COLOR == 0); @@ -1248,6 +1255,13 @@ _gtk_css_style_property_init_properties (void) GTK_CSS_AFFECTS_TRANSFORM, transform_value_parse, _gtk_css_transform_value_new_none ()); + gtk_css_style_property_register ("transform-origin", + GTK_CSS_PROPERTY_TRANSFORM_ORIGIN, + GTK_STYLE_PROPERTY_ANIMATED, + GTK_CSS_AFFECTS_TRANSFORM, + transform_origin_parse, + _gtk_css_position_value_new (_gtk_css_number_value_new (50, GTK_CSS_PERCENT), + _gtk_css_number_value_new (50, GTK_CSS_PERCENT))); gtk_css_style_property_register ("min-width", GTK_CSS_PROPERTY_MIN_WIDTH, GTK_STYLE_PROPERTY_ANIMATED, |