gnome-control-center r8836 - trunk/capplets/display
- From: ssp svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-control-center r8836 - trunk/capplets/display
- Date: Tue, 5 Aug 2008 07:21:29 +0000 (UTC)
Author: ssp
Date: Tue Aug 5 07:21:28 2008
New Revision: 8836
URL: http://svn.gnome.org/viewvc/gnome-control-center?rev=8836&view=rev
Log:
Tue Aug 5 03:19:23 2008 S%GÃÂÂ% ren Sandmann <sandmann redhat com>
* xrandr-capplet.c (paint_output): Draw rotated outputs rotated.
Modified:
trunk/capplets/display/ChangeLog
trunk/capplets/display/xrandr-capplet.c
Modified: trunk/capplets/display/xrandr-capplet.c
==============================================================================
--- trunk/capplets/display/xrandr-capplet.c (original)
+++ trunk/capplets/display/xrandr-capplet.c Tue Aug 5 07:21:28 2008
@@ -1350,6 +1350,7 @@
PangoLayout *layout = get_display_name (app, output);
PangoRectangle extent;
GdkRectangle viewport;
+ double angle;
cairo_save (cr);
@@ -1376,6 +1377,46 @@
g_print ("%f %f %f %f\n", x, y, w * scale + 0.5, h * scale + 0.5);
#endif
+ cairo_save (cr);
+
+ cairo_translate (cr,
+ x + (w * scale + 0.5) / 2,
+ y + (h * scale + 0.5) / 2);
+
+ if (output->rotation & GNOME_RR_ROTATION_0)
+ {
+ angle = 0;
+ }
+ else if (output->rotation & GNOME_RR_ROTATION_90)
+ {
+ angle = G_PI / 2;
+ }
+ else if (output->rotation & GNOME_RR_ROTATION_180)
+ {
+ angle = G_PI;
+ }
+ else if (output->rotation & GNOME_RR_ROTATION_270)
+ {
+ angle = 1.5 * G_PI;
+ }
+ else
+ {
+ angle = 0;
+ }
+
+ cairo_rotate (cr, angle);
+
+ if (output->rotation & GNOME_RR_REFLECT_X)
+ cairo_scale (cr, -1, 1);
+
+ if (output->rotation & GNOME_RR_REFLECT_Y)
+ cairo_scale (cr, 1, -1);
+
+ cairo_translate (cr,
+ - x - (w * scale + 0.5) / 2,
+ - y - (h * scale + 0.5) / 2);
+
+
cairo_rectangle (cr, x, y, w * scale + 0.5, h * scale + 0.5);
cairo_clip_preserve (cr);
@@ -1391,12 +1432,12 @@
if (output == app->current_output)
{
cairo_rectangle (cr, x + 2, y + 2, w * scale + 0.5 - 4, h * scale + 0.5 - 4);
-
+
cairo_set_line_width (cr, 4);
cairo_set_source_rgba (cr, 0.33, 0.43, 0.57, 1.0);
cairo_stroke (cr);
}
-
+
cairo_rectangle (cr, x + 0.5, y + 0.5, w * scale + 0.5 - 1, h * scale + 0.5 - 1);
cairo_set_line_width (cr, 1);
@@ -1420,9 +1461,10 @@
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
pango_cairo_show_layout (cr, layout);
- g_object_unref (layout);
cairo_restore (cr);
+
+ g_object_unref (layout);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]