=== modified file 'src/wizardpen.c' --- src/wizardpen.c 2011-05-03 00:03:05 +0000 +++ src/wizardpen.c 2011-11-10 22:04:19 +0000 @@ -1200,7 +1200,7 @@ report_y = max(priv->topY, min(y, priv->bottomY)); } - // rotatate if specified + // rotate if specified if (priv->rotate90) { int tempval; if (report_y < 0) @@ -1214,6 +1214,17 @@ report_x = 1278; report_y = tempval; } + // try to do something reasonable if screen rotated since startup + if (priv->keepShape && + priv->screenX == screenInfo.screens[0]->height && + priv->screenY == screenInfo.screens[0]->width) + { + float ratio = (float)priv->screenX / priv->screenY; + if (ratio > 1) + report_x = min(report_x*ratio*ratio, priv->bottomX); + else + report_y = min(report_y/(ratio*ratio), priv->bottomY); + } report_buttons = buttons; // Tablet PC buttons