Skip to content

[Bug]cusor deviate when scale modefied by document.body.style.zoom #12645

Open

Description

@serfend

Version

4.7.0

Reproduction link

https://serfend.gitee.io/#/dashboard

Steps to reproduce

document.body.style.zoom = 1.25;

What is expected?

cusor should act at events position where it exactly is.

What is actually happening?

deviate about 25% on the right

Activity

  1. echarts-bot commented on May 15, 2020

    @echarts-bot

    Hi! We've received your issue and please be patient to get responded. 🎉
    The average response time is expected to be within one day for weekdays.

    In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

    If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to [email protected]. Please attach the issue link if it's a technical questions.

    If you are interested in the project, you may also subscribe our mail list.

    Have a nice day! 🍵

  2. added
    en
    pending
    on May 15, 2020
  3. plainheart commented on May 15, 2020

    @plainheart
    Member

    It seems to be a bug, but css zoom is a non-standard property and many browsers have a poor compatibility for css zoom (especially in Firefox). Is it necessary to fix?
    Instead, we can use document.body.style.transform = 'scale(1.25)' to resolve this requirement, which is working well.(Can I Use: CSS Transform)
    For IE or other browsers compatibilities, we can add browser prefix for it.

    document.body.style.webkitTransform = 'scale(1.25)';
    document.body.style.MozTransform = 'scale(1.25)';
    document.body.style.OTransform = 'scale(1.25)';
    document.body.style.msTransform = 'scale(1.25)';
    document.body.style.transform = 'scale(1.25)';

    or just add a class for body

    body {
      -ms-transform: scale(1.25);          /* IE 9 */
      -moz-transform: scale(1.25);         /* Firefox */
      -webkit-transform: scale(1.25);      /* Safari & Chrome */
      -o-transform: scale(1.25);           /* Opera */
      transform: scale(1.25);
    }
  4. serfend commented on May 16, 2020

    @serfend
    Author

    i'd try set transform:document.body.style.transform = 'scale(1.25)' , but it seems not work correctly.
    whole page zoom just out of browser.
    exception

  5. plainheart commented on May 17, 2020

    @plainheart
    Member

    Yes. This is a difference between zoom and scale. scale won't change the layout and element holds the same raw size after scaling, but zoom will change real size of an element and it will bring a re-rendering of the whole layout. That seems unexpected.

  6. added this to the TBD milestone on Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenpending

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions