Skip to content

Commit

Permalink
feat: avoid snapshoting it altogether
Browse files Browse the repository at this point in the history
  • Loading branch information
GeopJr committed Sep 27, 2024
1 parent 0cfece9 commit 5ddfe83
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Widgets/AudioPlayer/Visualizer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,16 @@ public class Tuba.Widgets.Audio.Visualizer : Gtk.Widget {
var point = Graphene.Point ().init (new_center_w, new_center_h);
snapshot.translate (point);

float res = (float) level * (int.min (MAX_CIRCLE_HEIGHT, win_h) - SQR) + SQR;
if (animations_enabled) {
float res = (float) level * (int.min (MAX_CIRCLE_HEIGHT, win_h) - SQR) + SQR;

var rect = Graphene.Rect ().init (- res / 2, - res / 2, res, res);
var rounded_rect = Gsk.RoundedRect ().init_from_rect (rect, 9999);
var rect = Graphene.Rect ().init (- res / 2, - res / 2, res, res);
var rounded_rect = Gsk.RoundedRect ().init_from_rect (rect, 9999);

snapshot.push_rounded_clip (rounded_rect);
snapshot.append_color (color, rect);
snapshot.pop ();
snapshot.push_rounded_clip (rounded_rect);
snapshot.append_color (color, rect);
snapshot.pop ();
}

if (cover_texture != null) {
var cover_rect = Graphene.Rect ().init (- SQR / 2, - SQR / 2, SQR, SQR);
Expand Down

0 comments on commit 5ddfe83

Please sign in to comment.