Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -684,12 +684,16 @@ private void validateMask(ImageData source, ImageData mask) {

@Override
public CursorHandle createHandle(Device device, int zoom) {
float accessibilityFactor = getPointerSizeScaleFactor();
int scaledZoom = (int) (zoom * accessibilityFactor);
ImageData scaledSource = DPIUtil.scaleImageData(device, this.source, scaledZoom, DEFAULT_ZOOM);
ImageData scaledMask = this.mask != null ? DPIUtil.scaleImageData(device, mask, scaledZoom, DEFAULT_ZOOM)
: null;

float scaledZoomFactor = zoom * getPointerSizeScaleFactor() / 100f;
int scaledSourceWidth = Math.round(this.source.width * scaledZoomFactor);
int scaledSourceHeight = Math.round(this.source.height * scaledZoomFactor);
ImageData scaledSource = this.source.scaledTo(scaledSourceWidth, scaledSourceHeight);
ImageData scaledMask = null;
if (this.mask != null) {
int scaledMaskWidth = Math.round(this.mask.width * scaledZoomFactor);
int scaledMaskHeight = Math.round(this.mask.height * scaledZoomFactor);
scaledMask = this.mask.scaledTo(scaledMaskWidth, scaledMaskHeight);
}
return setupCursorFromImageData(device, scaledSource, scaledMask, getHotpotXInPixels(zoom),
getHotpotYInPixels(zoom));
}
Expand Down
Loading