- for (int i = 0; i < 10; i++) {
- draw_star (cr, i, (i >= rating) ? disabled_color : active_color);
- }
+ cr.save ();
+ cr.rectangle (radius * rating / 5.0, 0, this.allocation.width - radius * rating / 5.0, this.allocation.height);
+ cr.clip ();
+ for (int i = rating/10; i < 10; i++)
+ draw_star (cr, i, radius, disabled_color);
+ cr.restore ();
+
+ cr.new_path ();
+ cr.rectangle (0, 0, radius * rating / 5.0, this.allocation.height);
+ cr.clip ();
+ for (int i = 0; i < (rating+5)/10; i++)
+ draw_star (cr, i, radius, active_color);