| 22 | void ImageViewCore::imageLoaded(int width, int height) { _imageSize = Size{(double)width, (double)height}; } |
| 23 | |
| 24 | Size ImageViewCore::sizeForSpace(Size availableSpace) const |
| 25 | { |
| 26 | Size result = _imageSize; |
| 27 | |
| 28 | if (availableSpace.width > availableSpace.height) { |
| 29 | float factor = result.width / result.height; |
| 30 | result.width = availableSpace.height * factor; |
| 31 | result.height = availableSpace.height; |
| 32 | } else { |
| 33 | float factor = result.height / result.width; |
| 34 | result.width = availableSpace.width; |
| 35 | result.height = availableSpace.width * factor; |
| 36 | } |
| 37 | return result; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | extern "C" JNIEXPORT void JNICALL Java_io_boden_android_NativeImageView_native_1imageLoaded(JNIEnv *env, |
nothing calls this directly
no outgoing calls
no test coverage detected