Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Cursor images are offset #409

Open
hobbitalastair opened this issue Aug 2, 2015 · 3 comments
Open

Cursor images are offset #409

hobbitalastair opened this issue Aug 2, 2015 · 3 comments

Comments

@hobbitalastair
Copy link

This is possibly related to #343 - the cursor images are offset, and I don't remember them being before.
Specifically, the:

  • Pointer image 'tip' is not on the actual point - it appears to be maybe 10 pixels down.
    Moving the mouse slowly down over a "highlightable" object shows this, as the image is highlighted before it should be, and de-highlights before the tip is fully off it.
  • Text insertion cursor image is offset erratically.
    I'm not so sure about this one, but it appears to be centered differently to the pointer image - it maybe ~15 pixels to the right of the pointer image?
    It's hard to select text, because you have to double click a cursor's length above the text...
@hobbitalastair
Copy link
Author

I've noticed that the cursor offset problem appears to be caused by the larger Weston cursor image being used, not the native Chromium one. Also, the cursor sometimes stays with the smaller image, even after being moved outside of the Chromium window.
However, the horizontal offset is more puzzling.

@michaelforney
Copy link
Contributor

I looked into this. BitmapCursorFactoryOzone uses the implicit Cursor(int type) constructor when it calls GetCursorBitmap, which initializes the scale factor of the cursor to 0.0. GetCursorBitmap returns the hot_1x hotspot only when the scale factor is 1.0, so we end up with cursor hotspots for the large cursors, even when the normal sized cursor are being shown. I'm not sure what the correct fix is, because BitmapCursorFactoryOzone doesn't know what scale factor to use, but setting it to 1.0f, as in the linked diff, fixed the issue for me.

https://gist.github.com/bfa2a4fb3abf37057497

@hobbitalastair
Copy link
Author

Still the same as of SouthSister. Thanks michaelforney for investigating.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants