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

feat: Add toolStyles and DragProbe #93

Merged
merged 11 commits into from
May 9, 2022
Merged

feat: Add toolStyles and DragProbe #93

merged 11 commits into from
May 9, 2022

Conversation

sedghi
Copy link
Member

@sedghi sedghi commented May 5, 2022

We will start by looking at the style hierarchy. The style hierarchy is as follow.

  • Annotation-level settings (with UID) set/getAnnotationToolStyle
    • Viewport-level tool settings set/getViewportToolStyle
      • Per-tool this layer: Length on this viewport
      • Global this layer: All tools in this viewport
        • toolGroup settings (for any tool specified in this toolGroup in all viewports of the toolGroup) set/getToolGroupToolStyle
          • Per-tool layer: Angle on this toolGroup in all viewports
          • Global this layer: All tools in this toolGroup in all viewports
            • Default level: set/getDefaultToolStyle
              • Per-tool layer (Length) settings
              • Global (app-level) settings (we provide a default).

In annotation rendering loop, upon getting a style for a certain property (color, lineDash, lineThickness)
we check whether the style is set at the annotation level (highest priority).
If not, we check whether any viewport-level setting is set (for the viewport annotation is drawing on); however,
in the viewportLevel, we first check whether the tool-level setting is set. If not, we check in the "global" (all tools in the viewport) level.
If not found, we move to the next level for toolGroup level. If not found, we move to the next level for global level which is last
level to check.

Other stuff:

  • Add Drag probe
  • Fix a bug where textlines changing would not appear

Copy link
Member

@JamesAPetts JamesAPetts left a comment

Choose a reason for hiding this comment

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

Minor comments, LGTM, other than type renamings we talked about in meeting.

@sedghi sedghi changed the title feat: Add hierarchical toolStyles for annotations feat: Add toolStyles and DragProbe May 5, 2022
Copy link
Member

@JamesAPetts JamesAPetts left a comment

Choose a reason for hiding this comment

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

Looks good other than the Drag Probe Tool which needs a rethink.

packages/tools/src/tools/annotation/DragProbeTool.ts Outdated Show resolved Hide resolved
Copy link
Member

@JamesAPetts JamesAPetts left a comment

Choose a reason for hiding this comment

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

One change, lets discuss on zoom later today.

packages/tools/src/tools/annotation/DragProbeTool.ts Outdated Show resolved Hide resolved
@sedghi sedghi merged commit ba15be6 into main May 9, 2022
@swederik swederik deleted the feat/toolStyle branch July 8, 2022 09:32
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.

2 participants