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

Function DimsFor

internal/app/notes.go:49–60  ·  view source on GitHub ↗

DimsFor returns rendered note size at a zoom level.

(zoom int)

Source from the content-addressed store, hash-verified

47
48// DimsFor returns rendered note size at a zoom level.
49func DimsFor(zoom int) NoteDims {
50 s := zoomScale(zoom)
51 w := int(float32(baseNoteW)*s + 0.5)
52 h := int(float32(baseNoteH)*s + 0.5)
53 if w < 6 {
54 w = 6
55 }
56 if h < 4 {
57 h = 4
58 }
59 return NoteDims{W: w, H: h}
60}
61
62// WorldX / WorldY convert a screen cell coordinate to the equivalent
63// world coordinate given the zoom scale.

Callers 4

ScreenRectMethod · 0.85
NewNoteMethod · 0.85
drawShadowFunction · 0.85
drawNoteFunction · 0.85

Calls 1

zoomScaleFunction · 0.85

Tested by

no test coverage detected