Panel Arrangement is unusable · Issue #13 · Kode/KodeGarden · GitHub
Skip to content

Panel Arrangement is unusable #13

Open

Description

@jpryne

On Windows 10, I consistently get an unusable window arrangement, as shown in the image below. This may be due to having multiple monitors, as I also have an Oculus Rift installed.

kha

Activity

  1. RobDangerous commented on Apr 9, 2019

    @RobDangerous
    Member

    Different DPI scaling options per monitor? Same in other browsers?

  2. ianharrigan commented on Apr 10, 2019

    @ianharrigan
    Collaborator

    Toolkit.autoScale = false should fix that before kodegarden loads, i can make the change but need a little bit of time as i dont have anything setup for KG. Before this line should work: https://github.com/Kode/KodeGarden/blob/master/Client/src/Main.hx#L8

    I would be interested to see what Screen.instance.dpi returns in this case also

  3. jpryne commented on Apr 11, 2019

    @jpryne
    Author

    This may also be due to my Windows Accessability settings, as I often enlarge the text for easy reading.

    @ianharrigan Not sure if I'm doing it right, but when I enter "Screen.instance.dpi" into the console, "TypeError: Screen.instance is undefined", though "Screen" is recognized.

  4. ianharrigan commented on Apr 12, 2019

    @ianharrigan
    Collaborator

    Yeah, thats probably not going to work - haxeui doesnt expose the classes by default, the Screen you are seeing is the browsers, not haxeui's.

    Can you run this .html (attached) click the button and paste the values? The easiest option would to probably just switch off autoscaling, or change the threshold, would be interesting to see what the values are for your system though.

    Cheers,
    Ian

    html5.zip

    For reference, i get:

    image

  5. jpryne commented on Apr 12, 2019

    @jpryne
    Author

    image

  6. jpryne commented on Apr 12, 2019

    @jpryne
    Author

    Also, I have a 4K monitor, though I typically have it set to 1080p.

  7. ianharrigan commented on Apr 12, 2019

    @ianharrigan
    Collaborator

    ... that'll do it... i wonder why your dpi is so high though... Looking at how haxeui-html5 calcs this.

  8. ianharrigan commented on Apr 12, 2019

    @ianharrigan
    Collaborator
        public static function get_dpi():Float {
            if (_dpi != 0) {
                return _dpi;
            }
    
            var div = Browser.document.createElement("div");
            div.style.width = "1in";
            div.style.height = "1in";
            div.style.position = "absolute";
            div.style.top = "-99999px"; // position off-screen!
            div.style.left = "-99999px"; // position off-screen!
            Browser.document.body.appendChild(div);
            
            var devicePixelRatio:Null<Float> = Browser.window.devicePixelRatio;
            if (devicePixelRatio == null) {
                devicePixelRatio = 1;
            }
            
            _dpi = div.offsetWidth * devicePixelRatio;
            HtmlUtils.removeElement(div);
            return _dpi;
        }

    Seems like its a little complex... wonder how this can be improved.

  9. jpryne commented on Apr 12, 2019

    @jpryne
    Author

    Maybe it's grabbing specs from my Oculus Rift? (High resolution, small screen)

  10. jpryne commented on Apr 12, 2019

    @jpryne
    Author

    My window.devicePixelRatio is 2.5 (96 * 2.5 = 240)

  11. ianharrigan commented on Apr 12, 2019

    @ianharrigan
    Collaborator

    i wonder why? The easy option here is to turn of auto scaling in haxeui, its not needed for KG, but its a strange one regardless

  12. jpryne commented on Apr 12, 2019

    @jpryne
    Author

    I'm using a 4K uhdtv as my main screen. (I'm Batman.) :|

  13. ianharrigan commented on Apr 12, 2019

    @ianharrigan
    Collaborator

    is that detectable? Can you think of there being a better way to calc this dpi setting?

  14. jpryne commented on Apr 12, 2019

    @jpryne
    Author

    I hope not. It's supposed to be a secr- oh, you mean the dpi? Is it important for the graphics? Seems logical to let the browser handle it.

  15. ianharrigan commented on Apr 12, 2019

    @ianharrigan
    Collaborator

    Yeah, autoScaling off would fix it...

  16. jpryne commented on Apr 15, 2019

    @jpryne
    Author

    Ok, how do I turn off autoScaling?

  17. ianharrigan commented on Apr 24, 2019

    @ianharrigan
    Collaborator

    the Toolkit.autoScale needs to be set to false before the app starts, its not something that can be changed at runtime... i can make a "blind" PR but dont want to build it as my version of haxeui is no doubt different and i dont have a setup to run kodegarden locally at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions