Git Product home page Git Product logo

Comments (12)

nathancahill avatar nathancahill commented on August 27, 2024

After switching to getBoundingClientRect() and getting exact widths as floats, the issue is still there. So it must be something else.

from split.

RodMontgomery avatar RodMontgomery commented on August 27, 2024

I have never seen the right edge creep right, only left.

from split.

nathancahill avatar nathancahill commented on August 27, 2024

Yes, should have phrased that better. That's correct.

from split.

RodMontgomery avatar RodMontgomery commented on August 27, 2024

I activated the Firefox Developer Tools Inspector and looked at the widths of the panes in the three-pane example.
Before dragging any gutters, the widths were, from left to right, 33.3333%-5px 33.3333%-10px 33.3333%-5px -- all good.
After dragging the leftmost gutter slightly left, the widths were 30.4802%-5px 32.4635%-10px 33.3333%-5px.
Thus, the sum of the widths of the left and center panes, before allowing for gutters, went from 66.6666% to 62.9437%.
I still don't see why, though.

from split.

RodMontgomery avatar RodMontgomery commented on August 27, 2024

Is it the scrollbars? Does clientWidth include the scrollbars? If it does not, ...

from split.

nathancahill avatar nathancahill commented on August 27, 2024

Ah! Wasn't counting the half gutters on each side of the pair. Check out feb2e68, it gets it a lot closer. Still moves a bit.

from split.

RodMontgomery avatar RodMontgomery commented on August 27, 2024

clientWidth of the parent is 958. clientWidths of the three panes are -- in the three-pane example, before any gutter-dragging -- 299 294 299 which sum to 892. The two gutters total 20, bringing the total to 912.
The missing amount is 46 pixels. If it's the scrollbars, divide by three and get 15 pixels each, with one pixel left over. Doesn't quite look right -- the scrollbars don't look 50% larger than the gutters -- but where else would the missing pixels be hiding?
I think the calculation of this.percentage should not use parent.clientWidth in the denominator: using it makes the denominator too big.

from split.

nathancahill avatar nathancahill commented on August 27, 2024

The scroll bars are definitely counted. But you're right, there's a pixel missing (1.333px by my count after the last commits).

from split.

nathancahill avatar nathancahill commented on August 27, 2024

It might be a difference between CSS calc() and the math in the script. calc(33.333% - 5px) is 314.333 according to the browser. If I do the math, I get 314.68. Going to read up on how calc() works.

from split.

nathancahill avatar nathancahill commented on August 27, 2024

If you try the latest version I think I solved it. The script was counting the parent borders, while CSS calc() was not. 2 pixels off was enough to make the side creep left.

from split.

RodMontgomery avatar RodMontgomery commented on August 27, 2024

I think you've got it! Thanks!

from split.

nathancahill avatar nathancahill commented on August 27, 2024

Thank you for help debugging it!

from split.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.