Magnifier Methods
Overview
The RxCore.magnifier object exposes methods used to configure magnified
rendering, control magnification scale, and manage Precision Mode behavior.
All methods are accessed through the RxCore.magnifier instance.
Magnifier Methods
setCanvas
Assigns the canvases used by the magnifier.
Syntax
RxCore.magnifier.setCanvas(
baseCanvas: HTMLCanvasElement,
overlayCanvas: HTMLCanvasElement,
snapCanvas: HTMLCanvasElement
)
Parameters
baseCanvas– Canvas used for rendering magnified document contentoverlayCanvas– Canvas used for crosshairs and visual guidessnapCanvas– Canvas used for snap indicators during alignment
Returns
None
setContext
Sets the rendering context and dimensions for the magnifier canvas.
Syntax
RxCore.magnifier.setContext(
ctx: CanvasRenderingContext2D,
width: number,
height: number
)
Parameters
ctx– Rendering contextwidth– Canvas widthheight– Canvas height
Returns
None
setOverlayContext
Sets the rendering context for the overlay canvas.
Syntax
RxCore.magnifier.setOverlayContext(ctx)
Parameters
ctx– Overlay rendering context
Returns
None
setSnapContext
Sets the rendering context for the snap canvas.
Syntax
RxCore.magnifier.setSnapContext(ctx)
Parameters
ctx– Snap rendering context
Returns
None
resetContext
Resets internal scaling and transformations applied to the magnifier.
Syntax
RxCore.magnifier.resetContext()
Returns
None
setScale
Sets the magnification scale directly.
Syntax
RxCore.magnifier.setScale(nscale)
Parameters
nscale– Magnification factor
Returns
None
stepScale
Adjusts the magnification scale in fixed increments.
Syntax
RxCore.magnifier.stepScale(bUp)
Parameters
bUp– Increase scale iftrue, decrease iffalse
Returns
None
setActive
Enables or disables magnifier rendering.
Syntax
RxCore.magnifier.setActive(active)
Parameters
active– Enable or disable magnifier
Returns
None
update
Updates magnifier position, snapping behavior, and overlay visuals.
Syntax
RxCore.magnifier.update({ x, y })
Parameters
x– Pointer X coordinatey– Pointer Y coordinate
Returns
None
enterPrecisionMode
Enters Precision Mode and sets the anchor point used for alignment.
Syntax
RxCore.magnifier.enterPrecisionMode(anchor)
Parameters
anchor– Anchor identifier
Returns
None
exitPrecisionMode
Exits Precision Mode and restores normal magnifier behavior.
Syntax
RxCore.magnifier.exitPrecisionMode()
Returns
None
suspend
Temporarily suspends magnifier updates and rendering.
Syntax
RxCore.magnifier.suspend(state)
Parameters
state– Suspend state
Returns
None
clearOverlay
Clears all overlay visuals.
Syntax
RxCore.magnifier.clearOverlay()
Returns
None
drawOverlayPoint
Draws an overlay point or crosshair.
Syntax
RxCore.magnifier.drawOverlayPoint(x, y, color?, size?)
Parameters
x– X coordinatey– Y coordinatecolor– Optional colorsize– Optional size
Returns
None
drawCrosshair
Draws a crosshair at the current magnifier position.
Syntax
RxCore.magnifier.drawCrosshair(color?, size?, box?)
Parameters
color– Optional colorsize– Optional sizebox– Draw bounding box iftrue
Returns
None