diff options
author | Owen Taylor <otaylor@redhat.com> | 1999-01-27 18:21:20 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1999-01-27 18:21:20 +0000 |
commit | 14724626395882260fc73ae008a9df4fe7cbd877 (patch) | |
tree | d16769df30f0409e3faacd27a94b4a22a2be332d /gtk/gtklabel.c | |
parent | 90c7ea0b9138bb94bef9b01f37c7d3faffcbc6b7 (diff) | |
download | gtk+-14724626395882260fc73ae008a9df4fe7cbd877.tar.gz |
Use floor() instead of truncating to integer values so we get translation
Wed Jan 20 11:19:00 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklabel.c: Use floor() instead of truncating
to integer values so we get translation invariance.
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
and lower values for adjustments in size_allocate().
* gdk/gdkwindow.c gdk/gdk.h gdk/gdkprivate.h: New
function gdk_window_set_static_gravities() to set
up a window for guffaw scrolling.
* gdk/gdkwindow.c (gdk_window_internal_destroy): Set flags
indicating destroyed state before cleanup.
* gtk/gtkprivate.h gtk/gtkwidget.c: Add a new
private flag IS_OFFSCREEN. If set, this indicates
to GTK+ that the widget is not to be considered
viewable regardless of its map state. Queued draws
on offscreen widgets are suppressed.
Added new function static gtk_widget_is_offscreen() to
check this flag on a widget and its ancestors.
* gtk/gtklayout.[ch]: Major revisions.
- Use gdk_window_set_static_gravities to set static gravity
on all child windows, and thus avoid having to create a window
for NO_WINDOW children.
- Adjust allocations of children as we scroll them
so queued draws work correctly.
- Don't allocate our children directly in a put()
or move(); just queue a resize() like every other
widget.
* gtk/testgtk.c: Make the arrows on the scrollbars
work, create a larger and more demanding test.
Diffstat (limited to 'gtk/gtklabel.c')
-rw-r--r-- | gtk/gtklabel.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index e32efbac37..7c3fc744ea 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -15,6 +15,7 @@ * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <math.h> #include <string.h> #include "gtklabel.h" #include "gdk/gdkkeysyms.h" @@ -926,14 +927,14 @@ gtk_label_expose (GtkWidget *widget, gdk_gc_set_clip_rectangle (widget->style->white_gc, &event->area); gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], &event->area); - x = widget->allocation.x + misc->xpad + - (widget->allocation.width - label->max_width - 2 * misc->xpad) - * misc->xalign + 0.5; + x = floor (widget->allocation.x + misc->xpad + + ((widget->allocation.width - label->max_width - 2 * misc->xpad) + * misc->xalign) + 0.5); - y = (widget->allocation.y - + (widget->allocation.height - - widget->requisition.height) * misc->yalign - + misc->ypad + 0.5); + y = floor (widget->allocation.y + + (widget->allocation.height + - widget->requisition.height) * misc->yalign + + misc->ypad + 0.5); for (word = label->words; word; word = word->next) { gchar save = word->beginning[word->length]; |