• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Mouse coordinates issue

New Here ,
Nov 03, 2016 Nov 03, 2016

Copy link to clipboard

Copied

I'm trying to get the object under my mouse, which at first, worked. I was using:


var atMouse =  canvasTimeline.getObjectUnderPoint(e.stageX, e.stageY);

That worked until I embedded the canvas in HTML. It's in a Div that resizes it to 70% of the page's width. This seems to completely destroy the mouse coordinates system and any tutorial/approach I can find online.

I've tried systems using offsetX/offsetY, I've tried clientX,clientY, I think one of them was screenX,screenY, I've tried conversions that are supposed to convert page space to canvas space and... It fails at every turn.

What do I need to do, to get this working?

Views

125

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 05, 2016 Nov 05, 2016

Copy link to clipboard

Copied

LATEST

Can you share your files or hosted project somewhere to help us look into the issue. Also, are you using a Retina Mac/HiDPI display?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines