SheetDisplay Module
Functions and values
| Function or value | Description |
Full Usage:
displaySvgWithZoom model headerHeight style svgReact dispatch
Parameters:
Model
headerHeight : float
style : CSSProp list
svgReact : List<ReactElement>
dispatch : Dispatch<Msg>
Returns: ReactElement
|
|
Full Usage:
getDrawBlockPos ev headerHeight sheetModel
Parameters:
MouseEvent
headerHeight : float
sheetModel : Model
Returns: XYPos
|
|
Full Usage:
isPhysicalModifierHeld ()
Parameters:
unit
Returns: bool
|
|
|
|
Full Usage:
mouseOp op ev dispatch headerHeight
Parameters:
MouseOp
ev : MouseEvent
dispatch : Msg -> unit
headerHeight : float
|
|
|
Every wheel event over the canvas is decided here, and this is a NATIVE listener - registered non-passive on the document by Renderer.appSubscriptions - not a React one, because React 18 attaches its wheel listeners passively and a passive listener cannot preventDefault. A wheel that classifies as a zoom gesture - real Ctrl/Cmd held, or the synthetic ctrlKey Chromium puts on a trackpad pinch - must zoom and only zoom, so its native default (scrolling the canvas, or the browser's own page zoom) is suppressed even when the factor is too small to be worth dispatching: Ctrl + a diagonal two-finger scroll must not creep sideways. An unmodified wheel is left entirely alone, so the canvas scrolls natively as it always has. |
Full Usage:
setPhysicalModifierHeld value
Parameters:
bool
|
|
Full Usage:
view model headerHeight style overlay dispatch
Parameters:
Model
headerHeight : float
style : CSSProp list
overlay : ReactElement list
dispatch : Msg -> unit
Returns: ReactElement
|
View function, displays symbols / wires and possibly also a grid / drag-to-select box / connecting ports line / snap-to-grid visualisation `overlay` is drawn on top of the wires, in draw block coordinates, so it pans and zooms with the schematic. It exists for things the draw block cannot work out for itself - at present the value on the wire under the cursor, which only the UI layer knows, because only it knows a simulation is running. Empty the rest of the time.
|
|