Just starting out? Need help? Post your questions and find answers here.
poshu
 
Posts: 64
Joined: Mon Feb 24, 2014 11:46 pm

portait mode on HDPI?

by poshu Tue May 08, 2018 4:32 am

Hey!

on portrait mode phones, spiderbasic's gadget aren't being scaled properly; making them way too small and basically unusable.

Here is an example on a Chrome simulated iphone X :
horizontal, everything is fine :
Image

vertical, unreadable :
Image

Any way to fix that?
poshu
 
Posts: 64
Joined: Mon Feb 24, 2014 11:46 pm

Re: portait mode on HDPI?

by poshu Tue May 08, 2018 5:45 am

I tried to change the page scaling when the orientation changed... Not only does it messes with the touch input, but it doesn't scale right (might be my fault, I'm out of my comfort zone).
Code: Select all
Procedure Handler_Orientation(orientation)
   !document.body.style.transformOrigin = 'top left';
   If orientation = 90
      !document.body.style.transform = 'scale(1)';
   Else
      !document.body.style.transform = 'scale(' + window.devicePixelRatio + ')';
   EndIf
   
EndProcedure

!window.addEventListener("orientationchange", function() {
!   f_handler_orientation(Math.abs(screen.orientation.angle));
!});

Debug "somethin somethin'"
Quick demo of the result :
Image
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 0 guests