aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2021-10-01 21:52:12 +0200
committerache <ache@ache.one>2021-10-01 21:52:12 +0200
commitb56283dade66a6f650b28173b6a506d33604c2bd (patch)
treede24f4c2a2831c0a1c5146f744696ea172c999f6
parentDon't show the "Authenticating..." prompt until after a short delay (diff)
New logo panel
-rw-r--r--src/render.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/render.c b/src/render.c
index 71b6ed5..68d72a8 100644
--- a/src/render.c
+++ b/src/render.c
@@ -235,12 +235,31 @@ void draw_logo(saver_state_t *state)
cairo_t *cr = state->ctx;
+
+ // The initial coordinates
+ double fill_height = state->canvas_height;
+ double w_I = kLogoBackgroundWidth,
+ h_I = fill_height,
+ tetha = M_PI/7;
+
// Draw bar background
cairo_save(cr);
cairo_set_source_rgb(cr, (208.0 / 255.0), (69.0 / 255.0), (255.0 / 255.0));
- double fill_height = (state->canvas_height * state->logo_fill_progress);
- cairo_rectangle(cr, 0, 0, kLogoBackgroundWidth, fill_height);
+
+
+ // The final coordinates
+ int y = - sin(tetha) * w_I,
+ x = tan(tetha) * abs(y),
+ w = w_I * state->logo_fill_progress,
+ h = (h_I + abs(y)) / cos(tetha);
+
+ // Draw the rectangle
+ cairo_translate(cr, x, y);
+ cairo_rotate(cr, tetha);
+ cairo_rectangle(cr, 0, 0, w, h);
cairo_fill(cr);
+ // Rotate back to draw the logo
+ cairo_rotate(cr, -tetha);
// Common color -- transparent for logo
cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);