Giter Club home page Giter Club logo

Comments (5)

shaqaruden avatar shaqaruden commented on June 2, 2024

@thesobercoder I actually have a question. If the next monitor is not the same orientation how should sizing the window work and where should it be positioned? Currently I have it maintaining the same top and left position and will have it resize the window if it does not fit within the window.

from polygon.

thesobercoder avatar thesobercoder commented on June 2, 2024

@shaqaruden Thanks so much for helping me out with this. To answer your question, it is actually a tricky one because we have to consider two things -

  • The next monitor can be smaller than the current one (this can be tackled easily by always calculating the size in ratio of the monitor size)
  • The next monitor can be, as you mentioned, in a different orientation.

The way I think Rectangle does it, is by first calculating the size of the window (again in ratio of the destination monitor) and then place it in equal distance from both top/bottom and left/right. I think that should give us the desired effect. I'm open to other ideas. Let's keep chatting.

from polygon.

shaqaruden avatar shaqaruden commented on June 2, 2024

@shaqaruden Thanks so much for helping me out with this. To answer your question, it is actually a tricky one because we have to consider two things -

* The next monitor can be smaller than the current one (this can be tackled easily by always calculating the size in ratio of the monitor size)

* The next monitor can be, as you mentioned, in a different orientation.

The way I think Rectangle does it, is by first calculating the size of the window (again in ratio of the destination monitor) and then place it in equal distance from both top/bottom and left/right. I think that should give us the desired effect. I'm open to other ideas. Let's keep chatting.

So if I understand you correctly, lets say I place a window in the last fourth of a monitor then move it to another monitor it should maintain its relative position of the last fourth?

from polygon.

shaqaruden avatar shaqaruden commented on June 2, 2024

I'm going to create the PR now with what I have but leave it in a WIP state

from polygon.

thesobercoder avatar thesobercoder commented on June 2, 2024

@shaqaruden Thanks so much for helping me out with this. To answer your question, it is actually a tricky one because we have to consider two things -

* The next monitor can be smaller than the current one (this can be tackled easily by always calculating the size in ratio of the monitor size)

* The next monitor can be, as you mentioned, in a different orientation.

The way I think Rectangle does it, is by first calculating the size of the window (again in ratio of the destination monitor) and then place it in equal distance from both top/bottom and left/right. I think that should give us the desired effect. I'm open to other ideas. Let's keep chatting.

So if I understand you correctly, lets say I place a window in the last fourth of a monitor then move it to another monitor it should maintain its relative position of the last fourth?

Not really. The new size should dictate how the window will be positioned. Please remember that we are prescribing what, we think, is the best position on the next monitor. Like I said before, the position should always be center of the monitor based on the new size. This should work perfectly in most cases, I believe.

from polygon.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.