devdraw: add forcedpi toggled by Fn+F3 on Mac

R=rsc
http://codereview.appspot.com/6846104
This commit is contained in:
Russ Cox 2012-11-25 23:38:14 -05:00
parent 2589c5c6ee
commit 55905845f3
4 changed files with 20 additions and 3 deletions

View file

@ -11,6 +11,7 @@
#include "devdraw.h"
extern void _flushmemscreen(Rectangle);
int forcedpi = 0;
int displaydpi = 100;
#define NHASH (1<<5)
@ -1101,7 +1102,10 @@ _drawmsgwrite(void *v, int n)
err = "unknown query";
goto error;
case 'd': /* dpi */
fmtprint(&fmt, "%11d ", displaydpi);
if(forcedpi)
fmtprint(&fmt, "%11d ", forcedpi);
else
fmtprint(&fmt, "%11d ", displaydpi);
break;
}
}