summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscuri <scuri>2011-06-21 18:14:16 +0000
committerscuri <scuri>2011-06-21 18:14:16 +0000
commit5ec504d343ac1fbdee165a12a64d3a2253e8a4a7 (patch)
tree465ad1e81a57b3fa9d769f0a9e4c2e093ccf2253
parentf6be2614d2bf10ffffafd5e783c4bacfa0ea0923 (diff)
*** empty log message ***
-rw-r--r--src/cd_text.c10
-rw-r--r--src/gdiplus/cdwinp.cpp6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/cd_text.c b/src/cd_text.c
index 3a9eaa1..b2f369e 100644
--- a/src/cd_text.c
+++ b/src/cd_text.c
@@ -216,11 +216,11 @@ void cdfCanvasText(cdCanvas* canvas, double x, double y, const char *s)
int cdGetFontSizePixels(cdCanvas* canvas, int size)
{
if (size < 0)
- size = -size;
+ size = -size; /* size already in pixels */
else
{
- double size_mm = (double)size/CD_MM2PT;
- size = cdRound(size_mm*canvas->xres);
+ double size_mm = (double)size/CD_MM2PT; /* size in points, convert to mm first */
+ size = cdRound(size_mm*canvas->xres); /* from mm to pixels */
}
if (size == 0)
@@ -233,8 +233,8 @@ int cdGetFontSizePoints(cdCanvas* canvas, int size)
{
if (size < 0)
{
- double size_mm = ((double)-size)/canvas->xres;
- size = cdRound(size_mm * CD_MM2PT);
+ double size_mm = ((double)-size)/canvas->xres; /* size in pixels, convert to mm first */
+ size = cdRound(size_mm * CD_MM2PT); /* from mm to points */
}
if (size == 0)
diff --git a/src/gdiplus/cdwinp.cpp b/src/gdiplus/cdwinp.cpp
index 522f136..2a362d0 100644
--- a/src/gdiplus/cdwinp.cpp
+++ b/src/gdiplus/cdwinp.cpp
@@ -2745,8 +2745,8 @@ cdCtxCanvas *cdwpCreateCanvas(cdCanvas* canvas, Graphics* graphics, int wtype)
}
static ULONG_PTR cd_gdiplusToken = NULL;
-
-static void __stdcall DebugEvent(DebugEventLevel level, char* msg)
+
+static void __stdcall cd_DebugEvent(int level, char* msg)
{
(void)level;
MessageBox(NULL, msg, "GDI+ Debug", 0);
@@ -2758,7 +2758,7 @@ void cdwpGdiPlusStartup(int debug)
{
GdiplusStartupInput input;
if (debug)
- input.DebugEventCallback = DebugEvent;
+ input.DebugEventCallback = (DebugEventProc)cd_DebugEvent;
// Initialize GDI+.
GdiplusStartup(&cd_gdiplusToken, &input, NULL);