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,9 +65,9 @@ private class Games.GamepadView : Gtk.DrawingArea {
}
private void highlight_gamepad (Cairo.Context context) {
context.push_group ();
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);
var group = context.pop_group ();
......@@ -76,6 +76,7 @@ private class Games.GamepadView : Gtk.DrawingArea {
context.set_source_rgba (color.red, color.green, color.blue, color.alpha);
context.mask (group);
}
}
private void calculate_image_dimensions (out double x, out double y, out double scale) {
double w = get_allocated_width ();
......
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