class ScaledPosition { static int getWidth( double screenwidth, double videowidth, double screenposition) { int scaledWidth; if (screenwidth < videowidth) { scaledWidth = ((screenwidth / videowidth) * screenposition).round(); } else if (screenwidth == videowidth) { scaledWidth = screenposition.round(); } else { scaledWidth = ((videowidth / screenwidth) * screenposition).round(); } return scaledWidth; } static int getHeight( double screenheight, double videoheight, double screenposition) { int scaledHeight; if (screenheight < videoheight) { scaledHeight = ((screenheight / videoheight) * screenposition).round(); } else if (screenheight == videoheight) { scaledHeight = screenposition.round(); } else { scaledHeight = ((videoheight / screenheight) * screenposition).round(); } return scaledHeight; } }