Skip to content
Snippets Groups Projects
Commit 1a46572a authored by Bruce Cowan's avatar Bruce Cowan
Browse files

Fix odd widths

Didn't realise the GTK+ drawing functions took floats
parent d45a3d8f
No related branches found
No related tags found
No related merge requests found
......@@ -80,10 +80,10 @@ rugby_possibility_widget_get_preferred_height (GtkWidget *widget,
static void
render_bar (cairo_t *cr,
GtkStyleContext *context,
gint x,
gint y,
gint w,
gint h,
gdouble x,
gdouble y,
gdouble w,
gdouble h,
const gchar *style)
{
gtk_style_context_save (context);
......@@ -98,9 +98,9 @@ rugby_possibility_widget_draw (GtkWidget *widget,
{
RugbyPossibilityWidget *self = RUGBY_POSSIBILITY_WIDGET (widget);
gint width = gtk_widget_get_allocated_width (widget);
gint height = gtk_widget_get_allocated_height (widget);
gint x = 0, y = 0;
gdouble width = gtk_widget_get_allocated_width (widget);
gdouble height = gtk_widget_get_allocated_height (widget);
gdouble x = 0.0, y = 0.0;
GtkStyleContext *context = gtk_widget_get_style_context (widget);
gtk_style_context_save (context);
......@@ -121,7 +121,7 @@ rugby_possibility_widget_draw (GtkWidget *widget,
gtk_style_context_add_class (context, "fill-block");
// Tries
gint w = width / (score / 7.0);
gdouble w = width / (score / 7.0);
for (int i = 0; i < tries; i++)
{
render_bar (cr, context, x, y, w, height, "score-try");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment