algorithm for placing objects freely on a screen
with my application I have different objects (for simplicity let's say all rectangles) that can be of different sized and located freely on screen (drag/drop).
The problem I have is that a user create the page on certain screen size but it gets viewed on different screen sizes. It's not a big deal if differences are small say 15" vs 14" laptops) but it looks quite messed up if created on say 27" mac and viewed on 14" laptop.
I tried storing screen dimensions and then resizing/relocating object relatively but didnt work that well.
Do you know of an algorithm to solve such a problem? if not do 开发者_高级运维you recommend a method/idea of how I go about solving that?
Resizing & relocating relatively sounds fine. The only problem is that a square drawn at 800x600 will not be a square on 1920x1200 unless you also compensate for screen ratio. Then if you start compensating for screen ratio to keep squares squared you get letterboxing issues.
精彩评论