testeronious@lemmy.world to Programming@programming.dev · 1 年前Hardest Problem in Computer Science: Centering Thingstonsky.meexternal-linkmessage-square20fedilinkarrow-up1138cross-posted to: [email protected][email protected]
arrow-up1138external-linkHardest Problem in Computer Science: Centering Thingstonsky.metesteronious@lemmy.world to Programming@programming.dev · 1 年前message-square20fedilinkcross-posted to: [email protected][email protected]
minus-squareAngryPancake@sh.itjust.workslinkfedilinkarrow-up15·1 年前As a computer science problem it ends at position = window center / 2 - object width / 2
minus-squareTrollception@lemmy.worldlinkfedilinkarrow-up1·1 年前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.
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.