GraphiteEditor / Graphite

2D vector & raster editor that melds traditional layers & tools with a modern node-based, non-destructive, procedural workflow.
https://graphite.rs
Apache License 2.0
7.31k stars 387 forks source link

Place new folders in the correct stack order relative to other selected layers #1678

Closed moOsama76 closed 3 months ago

moOsama76 commented 3 months ago

Sub-issue: new folder creation, closes #1633

Keavon commented 3 months ago

!build

github-actions[bot] commented 3 months ago
📦 Build Complete for 977daea84913104aae411365ae8674fb041cbca4
https://fe30e139.graphite.pages.dev
Keavon commented 3 months ago

We'd like it to be placed just above the least-nested layer/folder that has a selection:

image

Right this this goes at the very top which isn't desired. I see in your code, you're using an insert index of 0 which will instead need to be calculated accordingly.

moOsama76 commented 3 months ago

Yes sure, sorry about that

On Tue, Mar 12, 2024 at 1:31 AM Keavon Chambers @.***> wrote:

We'd like it to be placed just above the least-nested layer/folder that has a selection:

image.png (view on web) https://github.com/GraphiteEditor/Graphite/assets/4388688/73a961bc-7489-4bc4-bd89-e5f18725fa0d

Right this this goes at the very top which isn't desired. I see in your code, you're using an insert index of 0 which will instead need to be calculated accordingly.

— Reply to this email directly, view it on GitHub https://github.com/GraphiteEditor/Graphite/pull/1678#issuecomment-1989636328, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQEFUOLXIHDENR3FHDUY3ETYXZEG7AVCNFSM6AAAAABEQ5I4GKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBZGYZTMMZSHA . You are receiving this because you authored the thread.Message ID: @.***>

Keavon commented 3 months ago

Please see my diff (49ed33732b0b93fe62a11efe97385328614dd32d) to learn from my little cleanup so you can write more idiomatic and performant Rust in the future :)