MCPcopy Create free account
hub / github.com/B33pBeeps/redthread / zoomScale

Function zoomScale

internal/app/notes.go:27–44  ·  view source on GitHub ↗

zoomScale returns the render-time scale factor applied to BOTH the note dimensions AND the note positions. This is "workspace zoom": at zoom -3 the whole board is shrunk so more notes fit; at zoom +1 notes are bigger and spread further apart.

(z int)

Source from the content-addressed store, hash-verified

25// the whole board is shrunk so more notes fit; at zoom +1 notes are
26// bigger and spread further apart.
27func zoomScale(z int) float32 {
28 switch z {
29 case -3:
30 return 0.40
31 case -2:
32 return 0.55
33 case -1:
34 return 0.75
35 case 0:
36 return 1.00
37 case +1:
38 return 1.35
39 }
40 if z < ZoomMin {
41 return zoomScale(ZoomMin)
42 }
43 return zoomScale(ZoomMax)
44}
45
46type NoteDims struct{ W, H int }
47

Callers 4

DimsForFunction · 0.85
WorldXFunction · 0.85
ScreenXFunction · 0.85
ScreenDeltaToWorldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected