take the reading direction into account and do the right thing for RTL
2008-02-26 Sven Neumann <sven@gimp.org> * plug-ins/print/print-preview.c: take the reading direction into account and do the right thing for RTL languages. svn path=/trunk/; revision=24982
This commit is contained in:

committed by
Sven Neumann

parent
bde85d9423
commit
fff02fb02e
@ -1,3 +1,8 @@
|
||||
2008-02-26 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/print/print-preview.c: take the reading direction into
|
||||
account and do the right thing for RTL languages.
|
||||
|
||||
2008-02-26 Kevin Cozens <kcozens@cvs.gnome.org>
|
||||
|
||||
* plug-ins/script-fu/scripts/frosty-logo.scm: Commited slightly
|
||||
|
@ -416,6 +416,13 @@ print_preview_expose_event (GtkWidget *widget,
|
||||
widget->allocation.x + border,
|
||||
widget->allocation.y + border);
|
||||
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
||||
{
|
||||
gint width = widget->allocation.width - 2 * border;
|
||||
|
||||
cairo_translate (cr, width - scale * paper_width, 0);
|
||||
}
|
||||
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
|
||||
/* draw page background */
|
||||
@ -632,18 +639,33 @@ print_preview_is_inside (PrintPreview *preview,
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
{
|
||||
gdouble left_margin;
|
||||
gdouble right_margin;
|
||||
gdouble top_margin;
|
||||
gdouble bottom_margin;
|
||||
gdouble scale;
|
||||
GtkWidget *widget = GTK_WIDGET (preview);
|
||||
gdouble left_margin;
|
||||
gdouble right_margin;
|
||||
gdouble top_margin;
|
||||
gdouble bottom_margin;
|
||||
gdouble scale;
|
||||
gint border = GTK_CONTAINER (widget)->border_width + 1;
|
||||
|
||||
x -= border;
|
||||
|
||||
scale = print_preview_get_scale (preview);
|
||||
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
||||
{
|
||||
gdouble paper_width;
|
||||
gdouble paper_height;
|
||||
gint width = widget->allocation.width - 2 * border;
|
||||
|
||||
print_preview_get_page_size (preview, &paper_width, &paper_height);
|
||||
|
||||
x -= width - scale * paper_width;
|
||||
}
|
||||
|
||||
print_preview_get_page_margins (preview,
|
||||
&left_margin, &right_margin,
|
||||
&top_margin, &bottom_margin);
|
||||
|
||||
scale = print_preview_get_scale (preview);
|
||||
|
||||
x = x / scale - left_margin;
|
||||
y = y / scale - top_margin;
|
||||
|
||||
|
Reference in New Issue
Block a user