Artifact [6d7c8ac265]
Not logged in

Artifact 6d7c8ac265f053b13db903647c13fc3aa87c5b0c:

Ticket change [6d7c8ac265] - Ticket [0c7dac6fccdf5eb6|0c7dac6fcc] <i>[tk scaling] on undroidwish gives different results than on wish, on the same machine</i> status still Closed with 3 other changes by anonymous 2019-05-17 11:38:04.
D 2019-05-17T11:38:04.008
J icomment More\son\sthis\sissue:\r\n<br><br>\r\nMy\sgoal\sis\sto\spresent\san\ssdltk\swindow\son\sa\sdesktop\sPC\sthat\saccurately\semulates\sthe\sscreen\sof\sa\smobile\sphone/tablet\sdevice.\sTo\sachieve\sthis\sI\sdo\sthe\sfollowing:\r\n<ol>\r\n<li>Write\sdown\sthe\starget\sdevice's\sdensitydpi\sand\sdensity,\sas\sreturned\sby\sthe\scommand\s`borg\sdisplaymetrics`\srun\son\sandrowish\son\sthe\smobile\sdevice.\sAn\sexample\sof\ssuch\sresult\sfrom\san\sactual\sdevice\sis:\s`densitydpi\s240\sdensity\s1.5`</li>\r\n<li>On\sthe\sPC,\srun\s`undroidwish\s-sdlxdpi\s<densitydpi>`,\swhere\s<densitydpi>\sis\sthe\svalue\sreturned\sby\sthe\sabove\s`borg\sdisplaymetrics`\scommand.</li>\r\n<li>Inside\sundroidwish,\srun\sthe\sfollowing\scode:</li>\r\n<code><pre>\r\n%\stk\sscaling\r\n3.344855967078189\r\n#\sset\s`tk\sscaling`\sto\sthe\s<density>\svalue\sreturn\sby\s`borg\sdisplaymetrics`\r\n%\stk\sscaling\s1.5\r\n#\screate\sa\sshape\swith\sspecs\sdependent\son\sdevice\sdpi:\r\n%\spack\s[frame\s.f\s-width\s20m\s-height\s20m\s-bg\sred]\s-padx\s20m\s-pady\s20m\s\r\n<pre><code>\r\n<li>Measure\sthe\sred\srectangular\srepresenting\sthe\sspecified\stk\sframe\swidget.\sResult:\sIt\smeasures\sexactly\sthe\sspecified\s20mm.</li>\r\n</ol>\r\nSo\sI\sconclude\sthat\sthis\smethod\sgives\san\sadequate\ssolution\sto\sthe\sset\sgoal.\sNow\sthe\sproblem:\r\n<br><br>\r\nWhile\stk\sseems\sto\sbe\scorrectly\sset\sto\sdisplay\sthe\scontent,\sthe\ssdltk\swindow\sborders\sare\sscaled\sby\sthe\s-sdlxdpi\svalue\sgiven\sat\sthe\scommand\sline,\swhich\sseems\sto\sbe\sapprox.\s240.0/72\s=\s3.333..,\sin\sthe\sabove\sexample.\s<a\shref='https://github.com/dzach/awemu/blob/master/issues/sdltk_border.png'>See\sthis\sscreenshot</a>.\sThe\ssize\sof\sthe\sfont\sin\sthe\sconsole\sis\snot\sa\sproblem;\sit\swill\sresize\sproperly\sonce\sthe\sconsole\sis\sredrawn\sby\sTk.\sBut...\r\n<br><br>\r\nI\shave\snot\sfound\sa\sway\sto\sset\ssdltk's\swindow\sborders.\sTk\scommands\sfor\stoplevel\swindows\sdo\snot\sseem\sto\sinfluence\ssdltk's\swindow\sdecoration\sin\sundroidwish.\sI\scan\smake\sthem\sdisappear,\se.g.\sby\srunning\s`wm\soverrideredirect`,\sbut\sthen\sthe\sability\sto\smove\sthe\swindows\saround\sis\slost.\s\r\n<br><br>\r\nHow\scan\sone\schange\swindow\sdecoration\ssizes\sin\ssdltk?\sIt\sseems\sthey\sshould\sbe\stied\sto\sthe\s`tk\sscaling`\sthat\sundroidwish\scomes\sup\swith\sinitially.
J login anonymous
J mimetype text/html
K 0c7dac6fccdf5eb668b2073c6cc7777712944c29
U anonymous
Z 2e4bbe501bac30c8245a9c0ccd113359