Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix precision loss (int vs float mixup) #655

Open
wants to merge 2 commits into
base: 1.11
Choose a base branch
from

Commits on Oct 25, 2024

  1. fix precision loss (int vs float mixup)

    The origin X/Y comes from Page.getLayoutMetrics.cssContentSize which returns float values like -0.666748046875 , not integers, but the library erroneously treated it like integers, that can cause Mouse()->click to miss-click on very small targets, and with custom error handlers it can also cause
    ["trace":"Exception":private]=>
        array(9) {
          [0]=>
          array(4) {
            ["file"]=>
            string(52) "C:\temp\vendor\chrome-php\chrome\src\Input\Mouse.php"
            ["line"]=>
            int(338)
            ["function"]=>
            string(9) "{closure}"
            ["args"]=>
            array(4) {
              [0]=>
              int(8192)
              [1]=>
              string(69) "Implicit conversion from float -0.666748046875 to int loses precision"
              [2]=>
              string(52) "C:\temp\vendor\chrome-php\chrome\src\Input\Mouse.php"
              [3]=>
              int(338)
            }
          }
    divinity76 authored Oct 25, 2024
    Configuration menu
    Copy the full SHA
    b797ba0 View commit details
    Browse the repository at this point in the history
  2. doc

    divinity76 authored Oct 25, 2024
    Configuration menu
    Copy the full SHA
    3c6ca8b View commit details
    Browse the repository at this point in the history