• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zooniverse / front-end-monorepo / 13440953185 / 1
77%
master: 77%

Build:
DEFAULT BRANCH: master
Ran 20 Feb 2025 05:22PM UTC
Files 1438
Run time 50s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Feb 2025 05:18PM UTC coverage: 75.515% (-0.03%) from 75.544%
13440953185.1

push

github

web-flow
refactor(drawing-tools): replace scale prop with useScale hook (#6697)

* refactor(drawing-tools): replace scale prop with useScale hook

Replace the `scale` prop with a `useScale` hook in the drawing tools. It's useful to imitate `vector-effect: non-scaling-size` by inverting any scaling applied to a parent SVG element. The drawing tools remain the same size on the screen, no matter whether the subject image is zoomed in or zoomed out.

The scale it returns is the scale factor of the current subject, calculated from the size of the drawing canvas (client width / intrinsic width.)

```jsx
const scale = useScale();

return (
  <g ref={root} transform={`scale(1 / ${scale})`}>
    <circle cx={0} cy={0} r={10} />
  </g>
);
```

* add useScale to subject viewers

* Docs and example

* type annotations for useScale and SVGContext

* use stored svgContext.rotate in scale calculation

* Remove scale from drawing API readme

* Add DragHandle props for polygon onPointerDown

* clean up DragHandle props

---------

Co-authored-by: Mark Bouslog <mark@zooniverse.org>

10839 of 16550 branches covered (65.49%)

Branch coverage included in aggregate %.

16952 of 20252 relevant lines covered (83.71%)

398.47 hits per line

Source Files on job 13440953185.1
  • Tree
  • List 1438
  • Changed 74
  • Source Changed 30
  • Coverage Changed 30
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 13440953185
  • f61207d6 on github
  • Prev Job for on master (#13416714459.1)
  • Next Job for on master (#13462745198.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc