summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);