Please don't make this depend on current resolution. Pass in the reference resolution as a parameter instead so it can be used with any source resolution.