Skip to content

Instantly share code, notes, and snippets.

@kodabb
Last active Feb 10, 2017
Embed
What would you like to do?
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