Commit fff02fb0 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

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
parent bde85d94
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment