From: John Darrington Date: Tue, 25 Nov 2008 01:14:27 +0000 (+0900) Subject: Fixed minor bug getting the extent of the last unit X-Git-Tag: v0.7.1~115 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=255f5c186a7601a39cceb350ea5ad7a8d0b69107;p=pspp-builds.git Fixed minor bug getting the extent of the last unit --- diff --git a/lib/gtksheet/psppire-axis.c b/lib/gtksheet/psppire-axis.c index 4a8de3e8..7b154908 100644 --- a/lib/gtksheet/psppire-axis.c +++ b/lib/gtksheet/psppire-axis.c @@ -239,7 +239,11 @@ psppire_axis_get_unit_at_pixel (PsppireAxis *a, glong pixel) if (pixel >= tower_height (&a->tower)) { glong extra = pixel - tower_height (&a->tower); - return tower_count (&a->tower) + extra / a->default_size; + + if ( extra > a->min_extent - tower_height (&a->tower)) + extra = a->min_extent - tower_height (&a->tower); + + return tower_count (&a->tower) - 1 + extra / a->default_size; } node = tower_lookup (&a->tower, pixel, &node_start);