sp.getSize().height != cc.desktop.scaledHeight) {
cc.reconfigureViewport();
if (cc.desktop.cursor != null) {
- cc.setCursor(cc.desktop.cursor.width(),
- cc.desktop.cursor.height(),
- cc.desktop.cursor.hotspot,
- cc.desktop.cursor.data,
- cc.desktop.cursor.mask);
+ Cursor cursor = cc.desktop.cursor;
+ cc.setCursor(cursor.width(),cursor.height(),cursor.hotspot,
+ cursor.data, cursor.mask);
}
}
}
if (desktop != null) {
reconfigureViewport();
viewport.update(viewport.g);
- if (desktop.cursor != null)
- setCursor(desktop.cursor.width(), desktop.cursor.height(), desktop.cursor.hotspot, desktop.cursor.data, desktop.cursor.mask);
}
} else if(options.fixedRatioScale) {
viewer.scalingFactor.setParam("FixedRatio");
if (desktop != null) {
reconfigureViewport();
viewport.update(viewport.g);
- if (desktop.cursor != null)
- setCursor(desktop.cursor.width(), desktop.cursor.height(), desktop.cursor.hotspot, desktop.cursor.data, desktop.cursor.mask);
}
} else {
String scaleString =
if (oldScaleFactor != scaleFactor && desktop != null) {
reconfigureViewport();
viewport.update(viewport.g);
- if (desktop.cursor != null)
- setCursor(desktop.cursor.width(), desktop.cursor.height(), desktop.cursor.hotspot, desktop.cursor.data, desktop.cursor.mask);
}
}
int cw = (int)Math.floor((float)cursor.width() * scaleWidthRatio);
int ch = (int)Math.floor((float)cursor.height() * scaleHeightRatio);
int hint = java.awt.Image.SCALE_DEFAULT;
+ hotspot = new Point((int)Math.floor((float)hotspot.x * scaleWidthRatio),
+ (int)Math.floor((float)hotspot.y * scaleHeightRatio));
Image cursorImage = (cw <= 0 || ch <= 0) ? tk.createImage(bitmap) :
tk.createImage(bitmap).getScaledInstance(cw,ch,hint);
- softCursor = (tk.createCustomCursor(cursorImage,
- new java.awt.Point(hotspot.x,hotspot.y), "Cursor"));
+ softCursor = tk.createCustomCursor(cursorImage,
+ new java.awt.Point(hotspot.x,hotspot.y), "Cursor");
}
if (softCursor != null) {
return new Dimension(scaledWidth, scaledHeight);
}
- public void update(Graphics g) {
- //repaint();
- }
-
public void setScaledSize() {
if (!cc.options.autoScale && !cc.options.fixedRatioScale) {
scaledWidth = (int)Math.floor((float)cc.cp.width * (float)cc.scaleFactor/100.0);
}
}
+ public void repaint() {
+ if (graphics != null)
+ super.update(graphics);
+ }
String oldContents = "";