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

fixing the position and display of the segment labels during sketch mode #3796

Merged
merged 23 commits into from
Sep 10, 2024

Conversation

nadr0
Copy link
Collaborator

@nadr0 nadr0 commented Sep 5, 2024

closes #3076

The position of the label grew with the scale since it is in the offsetFromMidPoint. We need the parent container to be position properly and place the label inside of it, we don't need to reposition the label within the parent container.

  • Updated the styling to get closer to our designs
  • Support both light and dark mode
  • Added background color to have separate between the overlaid text and the line
  • Positioned the text at the midpoint of the line and have the text be centered
  • Works at different zoom levels

image
image

Copy link

qa-wolf bot commented Sep 5, 2024

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

vercel bot commented Sep 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Sep 10, 2024 6:24pm

@franknoirot
Copy link
Collaborator

Might need some padding around the text, on dark mode it looks a little accidental. py-0.5 px-2 maybe? You might just need pt-0.5, the line-height of that font messes with the visual padding

@lf94
Copy link
Contributor

lf94 commented Sep 5, 2024

  1. can we add a bit of padding
  2. can we remove the units (already globally specified)
  3. maybe add the smallest rounded corners
  4. (stretch goal) can we remove the sketch coloring? why doesnt lightmode have an internal color?

@franknoirot
Copy link
Collaborator

4 is the engine-side scene, which is dimmed when in sketch mode and frozen. I don't know why it's not visible in the light mode screenshot, probably because it was the first taken and there was not yet an engine-side Solid2D to render

@nadr0
Copy link
Collaborator Author

nadr0 commented Sep 5, 2024

  • can we add a bit of padding
  • can we remove the units (already globally specified)
  • maybe add the smallest rounded corners
  • stretch goal) can we remove the sketch coloring? why doesnt lightmode have an internal color?

Yeah, my first image didn't have that rendered I think I took the screenshot before that got rendered on the engine side.

Frank is right about the line height padding, it can be a little odd with this font.

image
image

@lf94
Copy link
Contributor

lf94 commented Sep 5, 2024

question: how does this look with a border color matching line colors?

@nadr0
Copy link
Collaborator Author

nadr0 commented Sep 5, 2024

question: how does this look with a border color matching line colors?

image
image

I can push this if we like it.

@lf94
Copy link
Contributor

lf94 commented Sep 5, 2024

I personally like it because it kind of ties together the line through the border - @franknoirot @Irev-Dev ?

@Irev-Dev
Copy link
Collaborator

Irev-Dev commented Sep 5, 2024

I'll let Frank make the call on this.

@nadr0
Copy link
Collaborator Author

nadr0 commented Sep 6, 2024

Suggestion from Max

in the drawing world you would align the text angle with the direction of the line

Added aligning the text to the slope of the line.

image
image

angle.mp4

@franknoirot
Copy link
Collaborator

Love it. I don't love the border around because it makes it feel like an input to me, I think that might increase the user complaints around the lack of ability to do the "double-click-to-edit-length" user flow. But I think this is awesome and I want it in more. I say punch it

@lf94
Copy link
Contributor

lf94 commented Sep 10, 2024

I don't love the border around because it makes it feel like an input to me, I think that might increase the user complaints around the lack of ability to do the "double-click-to-edit-length" user flow.

Isn't that a benefit? That users can do this in some upcoming PR?

Copy link
Collaborator

@franknoirot franknoirot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!

@@ -267,15 +267,16 @@ code {
}

.segment-length-label-text {
transform: translate(var(--x, 0), var(--y, 0));
transform: translate(var(--x, 0), var(--y, 0)) rotate(var(--degree, 0));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So clean!

@nadr0 nadr0 merged commit 78ceba6 into main Sep 10, 2024
24 checks passed
@nadr0 nadr0 deleted the nadro/3076/segment-text-fix branch September 10, 2024 21:22
@Irev-Dev
Copy link
Collaborator

Sorry this is late, and I don't think it's a huge problem since there's an obvious work around for users "zoom in"

But did notice at scale it disappears too late and covers the entire segment

image

const sketch001 = startSketchOn('XZ')
  |> startProfileAt([3.44, 3.48], %)
  |> line([1500.31, 1.06], %)

@lf94
Copy link
Contributor

lf94 commented Sep 11, 2024

Yeah the follow up PR could be when two boxes overlap they both disappear.

@Irev-Dev
Copy link
Collaborator

Sorry noticing all the things post merge.

Screenshare.-.2024-09-11.3_30_06.PM.mp4

It's kinda charming tbh.

@franknoirot franknoirot mentioned this pull request Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segment length indicators get unweildy at scale
4 participants