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

Added feature to display dimensions of rectangles and ellipses #9142

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

bsekachev
Copy link
Member

@bsekachev bsekachev commented Feb 24, 2025

Motivation and context

Added setting to display shape size of rectangles and ellipses without dragging/resizing them:

image image

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@bsekachev bsekachev requested a review from nmanovic as a code owner February 24, 2025 09:41
Copy link

user-select: none;
pointer-events: none;
}

.cvat_canvas_text_dimensions {
fill: cyan;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why cyan and not white? It feels we have 2 styles for the same thing now

Copy link
Member Author

Choose a reason for hiding this comment

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

To display different things in different colors
When everything is white, it is more difficult to read

Comment on lines +3131 to +3137

const normWidth = width.toFixed(1);
const normHeight = height.toFixed(1);
const normRot = state.rotation === 0 ? '' : `${state.rotation.toFixed(1)}\u00B0`;

block
.tspan(`${normWidth}x${normHeight}px ${normRot}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

We have similar code in shared.ts. Maybe there is a way to refactor this logic into separate funciton so we dont do the same thing in 2 places?

Copy link
Contributor

Choose a reason for hiding this comment

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

At least generation of text

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.17%. Comparing base (09bfb2a) to head (05dddaa).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9142      +/-   ##
===========================================
+ Coverage    73.16%   73.17%   +0.01%     
===========================================
  Files          446      446              
  Lines        45661    45675      +14     
  Branches      3907     3912       +5     
===========================================
+ Hits         33408    33423      +15     
+ Misses       12253    12252       -1     
Components Coverage Δ
cvat-ui 77.06% <100.00%> (+0.02%) ⬆️
cvat-server 70.04% <ø> (ø)

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.

3 participants