From 9f89521644f33c8b6164f06f7d7041514942eee6 Mon Sep 17 00:00:00 2001 From: guest3456 Date: Wed, 23 May 2018 10:10:12 -0400 Subject: [PATCH] wip Issue #17 --- Gdip_All.ahk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Gdip_All.ahk b/Gdip_All.ahk index 56c300f..3e3960d 100644 --- a/Gdip_All.ahk +++ b/Gdip_All.ahk @@ -2181,14 +2181,17 @@ Gdip_TextToGraphics(pGraphics, Text, Options, Font:="Arial", Width:="", Height:= if vPos { + if RegExMatch(vPos[0], "^(?i:vCentre|vCenter|Bottom|Down)$") && !IHeight + return -7 + ReturnRC := StrSplit(ReturnRC, "|") if (vPos[0] = "vCentre") || (vPos[0] = "vCenter") - ypos += (Height-ReturnRC[4])//2 + ypos := (IHeight-ReturnRC[4])//2 else if (vPos[0] = "Top") || (vPos[0] = "Up") ypos := 0 else if (vPos[0] = "Bottom") || (vPos[0] = "Down") - ypos := Height-ReturnRC[4] + ypos := IHeight-ReturnRC[4] CreateRectF(RC, xpos, ypos, Width, ReturnRC[4]) ReturnRC := Gdip_MeasureString(pGraphics, Text, hFont, hFormat, RC)