After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 663825 - calling gtk_progress_bar_set_fraction with a fraction > 1.0 causes the inner progress to overrun the gutter
calling gtk_progress_bar_set_fraction with a fraction > 1.0 causes the inner ...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-11-11 07:38 UTC by Reece H. Dunn
Modified: 2011-11-11 15:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkProgressbar: respect the range of 'fraction' (1.12 KB, patch)
2011-11-11 15:36 UTC, Matthias Clasen
committed Details | Review

Description Reece H. Dunn 2011-11-11 07:38:42 UTC
Calling, e.g.:

gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress), 1.1);

causes the inner progress to display over the right-hand gutter edge.

The fix for this would be to either return an error for fractions outside the 0..1 range, or to clamp the value inside gtk_progress_bar_set_fraction:

    if (fraction > 1.0) fraction = 1.0;
    if (fraction < 0.0) fraction = 0.0;
Comment 1 Matthias Clasen 2011-11-11 15:36:26 UTC
The following fix has been pushed:
242b1f1 GtkProgressbar: respect the range of 'fraction'
Comment 2 Matthias Clasen 2011-11-11 15:36:29 UTC
Created attachment 201236 [details] [review]
GtkProgressbar: respect the range of 'fraction'

The setter should not set the property to values outside the allowed
range.