Last active
February 10, 2017 17:11
-
-
Save kodawah/2dace1b894cdd3910ae87a6c1c832a21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint32_t max_coord = (uint32_t) -1; | |
size_t orig_width = (size_t) sc->width * max_coord / (max_coord - r - l); | |
size_t orig_height = (size_t) sc->height * max_coord / (max_coord - b - t); | |
sc->spherical->left_bound = ceil(orig_width * l / max_coord); | |
sc->spherical->top_bound = ceil(orig_height * t / max_coord); | |
sc->spherical->right_bound = orig_width - sc->width - sc->spherical->left_bound; | |
sc->spherical->bottom_bound = orig_height - sc->height - sc->spherical->top_bound; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment