[longomatch] Fix Area conversion in scalled canvas
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix Area conversion in scalled canvas
- Date: Tue, 28 Oct 2014 09:55:28 +0000 (UTC)
commit e3fe995c603adf6a8b824c46a3efea43feb92aae
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Sun Oct 26 19:52:03 2014 +0100
Fix Area conversion in scalled canvas
LongoMatch.Drawing.Cairo/CairoBackend.cs | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/LongoMatch.Drawing.Cairo/CairoBackend.cs b/LongoMatch.Drawing.Cairo/CairoBackend.cs
index 9c0b961..5c6921c 100644
--- a/LongoMatch.Drawing.Cairo/CairoBackend.cs
+++ b/LongoMatch.Drawing.Cairo/CairoBackend.cs
@@ -190,20 +190,20 @@ namespace LongoMatch.Drawing.Cairo
public Area UserToDevice (Area a)
{
- double x, y, d1, d2;
+ double x, y, x2, y2, x3, y3;
x = a.Start.X;
y = a.Start.Y;
CContext.UserToDevice (ref x, ref y);
Area ua = new Area (new Point (x, y), 0, 0);
- d1 = 0;
- d2 = a.Width;
- CContext.UserToDeviceDistance (ref d1, ref d2);
- ua.Width = d2 - d1;
- d1 = 0;
- d2 = a.Height;
- CContext.UserToDeviceDistance (ref d1, ref d2);
- ua.Height = d2 - d1;
+ x2 = a.TopRight.X;
+ y2 = a.TopRight.Y;
+ CContext.UserToDevice (ref x2, ref y2);
+ ua.Width = x2 - x;
+ x3 = a.BottomLeft.X;
+ y3 = a.BottomLeft.Y;
+ CContext.UserToDevice (ref x3, ref y3);
+ ua.Height = y3 - y;
return ua;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]