KABOOM!: replace translucent panel with a layered drop shadow
This commit is contained in:
+13
-15
@@ -386,21 +386,19 @@ void BoardWidget::draw_game_over_overlay(const Cairo::RefPtr<Cairo::Context>& cr
|
||||
cr->rotate(-0.06);
|
||||
cr->translate(-width / 2.0, -height / 2.0);
|
||||
|
||||
// Translucent panel for readability over the revealed board
|
||||
double pad = font_size * 0.35;
|
||||
double px = cx - pad;
|
||||
double py = cy - pad;
|
||||
double pw = ext.width + 2 * pad;
|
||||
double ph = ext.height + 2 * pad;
|
||||
double radius = font_size * 0.12;
|
||||
cr->set_source_rgba(0.0, 0.0, 0.0, 0.5);
|
||||
cr->move_to(px + radius, py);
|
||||
cr->arc(px + pw - radius, py + radius, radius, -M_PI / 2, 0);
|
||||
cr->arc(px + pw - radius, py + ph - radius, radius, 0, M_PI / 2);
|
||||
cr->arc(px + radius, py + ph - radius, radius, M_PI / 2, M_PI);
|
||||
cr->arc(px + radius, py + radius, radius, M_PI, 3 * M_PI / 2);
|
||||
cr->close_path();
|
||||
cr->fill();
|
||||
// Layered drop shadow (fakes softness without blurring), then the text
|
||||
cr->set_source_rgba(0.0, 0.0, 0.0, 0.35);
|
||||
cr->move_to(cx + 4, cy + 4);
|
||||
cr->show_text(msg);
|
||||
cr->set_source_rgba(0.0, 0.0, 0.0, 0.3);
|
||||
cr->move_to(cx + 3, cy + 3);
|
||||
cr->show_text(msg);
|
||||
cr->set_source_rgba(0.0, 0.0, 0.0, 0.2);
|
||||
cr->move_to(cx + 2, cy + 2);
|
||||
cr->show_text(msg);
|
||||
cr->set_source_rgba(0.0, 0.0, 0.0, 0.1);
|
||||
cr->move_to(cx + 1, cy + 1);
|
||||
cr->show_text(msg);
|
||||
|
||||
cr->set_source_rgb(1.0, 0.42, 0.08); // Explosive orange
|
||||
cr->move_to(cx, cy);
|
||||
|
||||
Reference in New Issue
Block a user