testeronious@lemmy.world to Programming@programming.dev · 7 months agoHardest Problem in Computer Science: Centering Thingstonsky.meexternal-linkmessage-square14fedilinkarrow-up1114arrow-down17cross-posted to: webdev@programming.dev
arrow-up1107arrow-down1external-linkHardest Problem in Computer Science: Centering Thingstonsky.metesteronious@lemmy.world to Programming@programming.dev · 7 months agomessage-square14fedilinkcross-posted to: webdev@programming.dev
minus-squaregrue@lemmy.worldlinkfedilinkEnglisharrow-up25arrow-down2·7 months agoCentering things is a graphic design problem, not a computer science problem.
minus-squareAngryPancake@sh.itjust.workslinkfedilinkarrow-up10·7 months agoAs a computer science problem it ends at position = window center / 2 - object width / 2
minus-squareTrollception@lemmy.worldlinkfedilinkarrow-up1arrow-down1·7 months agoIs not always this simple though. If the window has yet to be spawned in some languages the width will be unavailable, until after. Sometimes the window can be seen before it moves to the center which is a bit jarring.
minus-squareUckyBon@lemmy.worldlinkfedilinkEnglisharrow-up2·7 months agoThat’s a pretty good summary of the article actually. The design is bad because the people who made the tools are doing a bad job.
Centering things is a graphic design problem, not a computer science problem.
As a computer science problem it ends at position = window center / 2 - object width / 2
Is not always this simple though. If the window has yet to be spawned in some languages the width will be unavailable, until after. Sometimes the window can be seen before it moves to the center which is a bit jarring.
That’s a pretty good summary of the article actually.
The design is bad because the people who made the tools are doing a bad job.