Skip to content

Commit 1c51391

Browse files
committed
Minor code clean-up.
1 parent 0237a52 commit 1c51391

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/dtgtk/thumbnail.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,12 @@ static gboolean _event_cursor_draw(GtkWidget *widget,
421421
GdkRGBA col;
422422
gtk_style_context_get_color(context, state, &col);
423423

424+
const double w_width = gtk_widget_get_allocated_width(widget);
425+
const double w_height = gtk_widget_get_allocated_height(widget);
426+
424427
cairo_set_source_rgba(cr, col.red, col.green, col.blue, col.alpha);
425-
cairo_line_to(cr, gtk_widget_get_allocated_width(widget), 0);
426-
cairo_line_to(cr, gtk_widget_get_allocated_width(widget) / 2,
427-
gtk_widget_get_allocated_height(widget));
428+
cairo_line_to(cr, w_width, 0);
429+
cairo_line_to(cr, w_width / 2, w_height);
428430
cairo_line_to(cr, 0, 0);
429431
cairo_close_path(cr);
430432
cairo_fill(cr);

0 commit comments

Comments
 (0)