Commit f82701d2 authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko
Browse files

ui: Draw highlighted parts separately in GamepadView

For some reason, drawing them all in one group results in all parts but
the first one being misplaced. Hence draw each one in a separate group.
parent 56e3f930
Pipeline #30608 passed with stages
in 27 minutes and 26 seconds
...@@ -65,16 +65,17 @@ private class Games.GamepadView : Gtk.DrawingArea { ...@@ -65,16 +65,17 @@ private class Games.GamepadView : Gtk.DrawingArea {
} }
private void highlight_gamepad (Cairo.Context context) { private void highlight_gamepad (Cairo.Context context) {
context.push_group ();
for (var i = 0; i < configuration.input_paths.length; ++i) for (var i = 0; i < configuration.input_paths.length; ++i)
if (input_highlights[i]) if (input_highlights[i]) {
context.push_group ();
handle.render_cairo_sub (context, "#" + configuration.input_paths[i].path); handle.render_cairo_sub (context, "#" + configuration.input_paths[i].path);
var group = context.pop_group (); var group = context.pop_group ();
Gdk.RGBA color; Gdk.RGBA color;
get_style_context ().lookup_color ("theme_selected_bg_color", out color); get_style_context ().lookup_color ("theme_selected_bg_color", out color);
context.set_source_rgba (color.red, color.green, color.blue, color.alpha); context.set_source_rgba (color.red, color.green, color.blue, color.alpha);
context.mask (group); context.mask (group);
}
} }
private void calculate_image_dimensions (out double x, out double y, out double scale) { private void calculate_image_dimensions (out double x, out double y, out double scale) {
......
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