@univerjsengine-renderclassesUniverrenderingcontext2d

@univerjs/engine-render v0.5.0-beta.1 • Docs


Class: UniverRenderingContext2D

Extended by

Implements

  • CanvasRenderingContext2D

Constructors

new UniverRenderingContext2D()

new UniverRenderingContext2D(context): UniverRenderingContext2D

Parameters

ParameterType
contextCanvasRenderingContext2D

Returns

UniverRenderingContext2D

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:34

Properties

PropertyModifierTypeDefault valueDescriptionDefined in
__modepublicstring'rendering'-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:23
_contextpublicCanvasRenderingContext2Dundefined-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:28
canvasreadonlyHTMLCanvasElementundefinedMDN Referencepackages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:26
renderConfigpublicReadonly<IRenderConfig>{}-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:32

Accessors

direction

Get Signature

get direction(): CanvasDirection

MDN Reference

Returns

CanvasDirection

Set Signature

set direction(val): void

MDN Reference

Parameters
ParameterType
valCanvasDirection
Returns

void

Implementation of

CanvasRenderingContext2D.direction

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:205


fillStyle

Get Signature

get fillStyle(): string | CanvasGradient | CanvasPattern

MDN Reference

Returns

string | CanvasGradient | CanvasPattern

Set Signature

set fillStyle(val): void

MDN Reference

Parameters
ParameterType
valstring | CanvasGradient | CanvasPattern
Returns

void

Implementation of

CanvasRenderingContext2D.fillStyle

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:73


filter

Get Signature

get filter(): string

MDN Reference

Returns

string

Set Signature

set filter(val): void

MDN Reference

Parameters
ParameterType
valstring
Returns

void

Implementation of

CanvasRenderingContext2D.filter

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:91


font

Get Signature

get font(): string

MDN Reference

Returns

string

Set Signature

set font(val): void

MDN Reference

Parameters
ParameterType
valstring
Returns

void

Implementation of

CanvasRenderingContext2D.font

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:214


fontKerning

Get Signature

get fontKerning(): CanvasFontKerning

MDN Reference

Returns

CanvasFontKerning

Set Signature

set fontKerning(val): void

MDN Reference

Parameters
ParameterType
valCanvasFontKerning
Returns

void

Implementation of

CanvasRenderingContext2D.fontKerning

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:223


fontStretch

Get Signature

get fontStretch(): CanvasFontStretch

MDN Reference

Returns

CanvasFontStretch

Set Signature

set fontStretch(val): void

MDN Reference

Parameters
ParameterType
valCanvasFontStretch
Returns

void

Implementation of

CanvasRenderingContext2D.fontStretch

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:232


fontVariantCaps

Get Signature

get fontVariantCaps(): CanvasFontVariantCaps

MDN Reference

Returns

CanvasFontVariantCaps

Set Signature

set fontVariantCaps(val): void

MDN Reference

Parameters
ParameterType
valCanvasFontVariantCaps
Returns

void

Implementation of

CanvasRenderingContext2D.fontVariantCaps

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:243


globalAlpha

Get Signature

get globalAlpha(): number

MDN Reference

Returns

number

Set Signature

set globalAlpha(val): void

MDN Reference

Parameters
ParameterType
valnumber
Returns

void

Implementation of

CanvasRenderingContext2D.globalAlpha

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:55


globalCompositeOperation

Get Signature

get globalCompositeOperation(): GlobalCompositeOperation

MDN Reference

Returns

GlobalCompositeOperation

Set Signature

set globalCompositeOperation(val): void

MDN Reference

Parameters
ParameterType
valGlobalCompositeOperation
Returns

void

Implementation of

CanvasRenderingContext2D.globalCompositeOperation

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:64


imageSmoothingEnabled

Get Signature

get imageSmoothingEnabled(): boolean

MDN Reference

Returns

boolean

Set Signature

set imageSmoothingEnabled(val): void

MDN Reference

Parameters
ParameterType
valboolean
Returns

void

Implementation of

CanvasRenderingContext2D.imageSmoothingEnabled

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:100


imageSmoothingQuality

Get Signature

get imageSmoothingQuality(): ImageSmoothingQuality

MDN Reference

Returns

ImageSmoothingQuality

Set Signature

set imageSmoothingQuality(val): void

MDN Reference

Parameters
ParameterType
valImageSmoothingQuality
Returns

void

Implementation of

CanvasRenderingContext2D.imageSmoothingQuality

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:109


letterSpacing

Get Signature

get letterSpacing(): string

MDN Reference

Returns

string

Set Signature

set letterSpacing(val): void

MDN Reference

Parameters
ParameterType
valstring
Returns

void

Implementation of

CanvasRenderingContext2D.letterSpacing

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:254


lineCap

Get Signature

get lineCap(): CanvasLineCap

MDN Reference

Returns

CanvasLineCap

Set Signature

set lineCap(val): void

MDN Reference

Parameters
ParameterType
valCanvasLineCap
Returns

void

Implementation of

CanvasRenderingContext2D.lineCap

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:118


lineDashOffset

Get Signature

get lineDashOffset(): number

MDN Reference

Returns

number

Set Signature

set lineDashOffset(val): void

MDN Reference

Parameters
ParameterType
valnumber
Returns

void

Implementation of

CanvasRenderingContext2D.lineDashOffset

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:127


lineJoin

Get Signature

get lineJoin(): CanvasLineJoin

MDN Reference

Returns

CanvasLineJoin

Set Signature

set lineJoin(val): void

MDN Reference

Parameters
ParameterType
valCanvasLineJoin
Returns

void

Implementation of

CanvasRenderingContext2D.lineJoin

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:136


lineWidth

Get Signature

get lineWidth(): number

MDN Reference

Returns

number

Set Signature

set lineWidth(val): void

MDN Reference

Parameters
ParameterType
valnumber
Returns

void

Implementation of

CanvasRenderingContext2D.lineWidth

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:145


miterLimit

Get Signature

get miterLimit(): number

MDN Reference

Returns

number

Set Signature

set miterLimit(val): void

MDN Reference

Parameters
ParameterType
valnumber
Returns

void

Implementation of

CanvasRenderingContext2D.miterLimit

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:160


shadowBlur

Get Signature

get shadowBlur(): number

MDN Reference

Returns

number

Set Signature

set shadowBlur(val): void

MDN Reference

Parameters
ParameterType
valnumber
Returns

void

Implementation of

CanvasRenderingContext2D.shadowBlur

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:169


shadowColor

Get Signature

get shadowColor(): string

MDN Reference

Returns

string

Set Signature

set shadowColor(val): void

MDN Reference

Parameters
ParameterType
valstring
Returns

void

Implementation of

CanvasRenderingContext2D.shadowColor

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:178


shadowOffsetX

Get Signature

get shadowOffsetX(): number

MDN Reference

Returns

number

Set Signature

set shadowOffsetX(val): void

MDN Reference

Parameters
ParameterType
valnumber
Returns

void

Implementation of

CanvasRenderingContext2D.shadowOffsetX

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:187


shadowOffsetY

Get Signature

get shadowOffsetY(): number

MDN Reference

Returns

number

Set Signature

set shadowOffsetY(val): void

MDN Reference

Parameters
ParameterType
valnumber
Returns

void

Implementation of

CanvasRenderingContext2D.shadowOffsetY

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:196


strokeStyle

Get Signature

get strokeStyle(): string | CanvasGradient | CanvasPattern

MDN Reference

Returns

string | CanvasGradient | CanvasPattern

Set Signature

set strokeStyle(val): void

MDN Reference

Parameters
ParameterType
valstring | CanvasGradient | CanvasPattern
Returns

void

Implementation of

CanvasRenderingContext2D.strokeStyle

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:82


textAlign

Get Signature

get textAlign(): CanvasTextAlign

MDN Reference

Returns

CanvasTextAlign

Set Signature

set textAlign(val): void

MDN Reference

Parameters
ParameterType
valCanvasTextAlign
Returns

void

Implementation of

CanvasRenderingContext2D.textAlign

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:287


textBaseline

Get Signature

get textBaseline(): CanvasTextBaseline

MDN Reference

Returns

CanvasTextBaseline

Set Signature

set textBaseline(val): void

MDN Reference

Parameters
ParameterType
valCanvasTextBaseline
Returns

void

Implementation of

CanvasRenderingContext2D.textBaseline

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:296


textRendering

Get Signature

get textRendering(): CanvasTextRendering

MDN Reference

Returns

CanvasTextRendering

Set Signature

set textRendering(val): void

MDN Reference

Parameters
ParameterType
valCanvasTextRendering
Returns

void

Implementation of

CanvasRenderingContext2D.textRendering

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:265


wordSpacing

Get Signature

get wordSpacing(): string

MDN Reference

Returns

string

Set Signature

set wordSpacing(val): void

MDN Reference

Parameters
ParameterType
valstring
Returns

void

Implementation of

CanvasRenderingContext2D.wordSpacing

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:276

Methods

_getScale()

protected _getScale(): {
  scaleX: number;
  scaleY: number;
}

Get scale from ctx. DOMMatrix.a DOMMatrix.d would affect by ctx.rotate()

Returns

{
  scaleX: number;
  scaleY: number;
}
NameTypeDefined in
scaleXnumberpackages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:317
scaleYnumberpackages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:318

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:308


arc()

arc(
   x, 
   y, 
   radius, 
   startAngle, 
   endAngle, 
   counterClockwise?): void

arc function.

Parameters

ParameterType
xnumber
ynumber
radiusnumber
startAnglenumber
endAnglenumber
counterClockwise?boolean

Returns

void

Method

Implementation of

CanvasRenderingContext2D.arc

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:397


arcByPrecision()

arcByPrecision(
   x, 
   y, 
   radius, 
   startAngle, 
   endAngle, 
   counterClockwise?): void

arc function.

Parameters

ParameterType
xnumber
ynumber
radiusnumber
startAnglenumber
endAnglenumber
counterClockwise?boolean

Returns

void

Method

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:405


arcTo()

arcTo(
   x1, 
   y1, 
   x2, 
   y2, 
   radius): void

arcTo function.

Parameters

ParameterType
x1number
y1number
x2number
y2number
radiusnumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.arcTo

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:418


arcToByPrecision()

arcToByPrecision(
   x1, 
   y1, 
   x2, 
   y2, 
   radius): void

arcTo function.

Parameters

ParameterType
x1number
y1number
x2number
y2number
radiusnumber

Returns

void

Method

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:427


beginPath()

beginPath(): void

beginPath function.

Returns

void

Method

Implementation of

CanvasRenderingContext2D.beginPath

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:441


bezierCurveTo()

bezierCurveTo(
   cp1x, 
   cp1y, 
   cp2x, 
   cp2y, 
   x, 
   y): void

bezierCurveTo function.

Parameters

ParameterType
cp1xnumber
cp1ynumber
cp2xnumber
cp2ynumber
xnumber
ynumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.bezierCurveTo

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:449


bezierCurveToByPrecision()

bezierCurveToByPrecision(
   cp1x, 
   cp1y, 
   cp2x, 
   cp2y, 
   x, 
   y): void

bezierCurveTo function precision.

Parameters

ParameterType
cp1xnumber
cp1ynumber
cp2xnumber
cp2ynumber
xnumber
ynumber

Returns

void

Method

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:457


clearRect()

clearRect(
   x, 
   y, 
   width, 
   height): void

clearRect function.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.clearRect

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:473


clearRectByPrecision()

clearRectByPrecision(
   x, 
   y, 
   width, 
   height): void

clearRect function.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:481


clearRectForTexture()

clearRectForTexture(
   x, 
   y, 
   width, 
   height): void

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:1003


clip()

clip(undefined)

clip(): void

clip function.

Returns

void

Method
Implementation of

CanvasRenderingContext2D.clip

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:495

clip(path)

clip(path): void
Parameters
ParameterType
pathPath2D
Returns

void

Implementation of

CanvasRenderingContext2D.clip

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:497

clip(fillRule)

clip(fillRule?): void

MDN Reference

Parameters
ParameterType
fillRule?CanvasFillRule
Returns

void

Implementation of

CanvasRenderingContext2D.clip

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:499

clip(path, fillRule)

clip(path, fillRule?): void
Parameters
ParameterType
pathPath2D
fillRule?CanvasFillRule
Returns

void

Implementation of

CanvasRenderingContext2D.clip

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:501


closePath()

closePath(): void

closePath function.

Returns

void

Method

Implementation of

CanvasRenderingContext2D.closePath

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:511


closePathByEnv()

closePathByEnv(): void

Chrome hardware acceleration causes canvas stroke to fail to draw lines on Mac.

Returns

void

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:532


createConicGradient()

createConicGradient(
   startAngle, 
   x, 
   y): CanvasGradient

MDN Reference

Parameters

ParameterType
startAnglenumber
xnumber
ynumber

Returns

CanvasGradient

Implementation of

CanvasRenderingContext2D.createConicGradient

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:338


createImageData()

createImageData(width, height, settings)

createImageData(
   width, 
   height, 
   settings?): ImageData

createImageData function.

Parameters
ParameterType
widthnumber
heightnumber
settings?ImageDataSettings
Returns

ImageData

Method
Implementation of

CanvasRenderingContext2D.createImageData

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:549

createImageData(imagedata)

createImageData(imagedata): ImageData
Parameters
ParameterType
imagedataImageData
Returns

ImageData

Implementation of

CanvasRenderingContext2D.createImageData

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:551


createLinearGradient()

createLinearGradient(
   x0, 
   y0, 
   x1, 
   y1): CanvasGradient

createLinearGradient function.

Parameters

ParameterType
x0number
y0number
x1number
y1number

Returns

CanvasGradient

Method

Implementation of

CanvasRenderingContext2D.createLinearGradient

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:570


createPattern()

createPattern(image, repetition): null | CanvasPattern

createPattern function.

Parameters

ParameterType
imageCanvasImageSource
repetitionnull | string

Returns

null | CanvasPattern

Method

Implementation of

CanvasRenderingContext2D.createPattern

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:578


createRadialGradient()

createRadialGradient(
   x0, 
   y0, 
   r0, 
   x1, 
   y1, 
   r1): CanvasGradient

createRadialGradient function.

Parameters

ParameterType
x0number
y0number
r0number
x1number
y1number
r1number

Returns

CanvasGradient

Method

Implementation of

CanvasRenderingContext2D.createRadialGradient

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:586


drawFocusIfNeeded()

drawFocusIfNeeded(element)

drawFocusIfNeeded(element): void

MDN Reference

Parameters
ParameterType
elementElement
Returns

void

Implementation of

CanvasRenderingContext2D.drawFocusIfNeeded

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:378

drawFocusIfNeeded(path, element)

drawFocusIfNeeded(path, element): void
Parameters
ParameterType
pathPath2D
elementElement
Returns

void

Implementation of

CanvasRenderingContext2D.drawFocusIfNeeded

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:379


drawImage()

drawImage(
   image, 
   sx, 
   sy, 
   sWidth?, 
   sHeight?, 
   dx?, 
   dy?, 
   dWidth?, 
   dHeight?): void

drawImage function.

Parameters

ParameterType
imageCanvasImageSource
sxnumber
synumber
sWidth?number
sHeight?number
dx?number
dy?number
dWidth?number
dHeight?number

Returns

void

Method

Implementation of

CanvasRenderingContext2D.drawImage

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:594


ellipse()

ellipse(
   x, 
   y, 
   radiusX, 
   radiusY, 
   rotation, 
   startAngle, 
   endAngle, 
   counterclockwise?): void

ellipse function.

Parameters

ParameterType
xnumber
ynumber
radiusXnumber
radiusYnumber
rotationnumber
startAnglenumber
endAnglenumber
counterclockwise?boolean

Returns

void

Method

Implementation of

CanvasRenderingContext2D.ellipse

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:634


fill()

fill(fillRule)

fill(fillRule?): void

fill function.

Parameters
ParameterType
fillRule?CanvasFillRule
Returns

void

Method
Implementation of

CanvasRenderingContext2D.fill

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:670

fill(path, fillRule)

fill(path, fillRule?): void
Parameters
ParameterType
pathPath2D
fillRule?CanvasFillRule
Returns

void

Implementation of

CanvasRenderingContext2D.fill

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:672


fillRect()

fillRect(
   x, 
   y, 
   width, 
   height): void

fillRect function.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.fillRect

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:684


fillRectByPrecision()

fillRectByPrecision(
   x, 
   y, 
   width, 
   height): void

fillRect function precision.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:692


fillText()

fillText(
   text, 
   x, 
   y, 
   maxWidth?): void

fillText function.

Parameters

ParameterType
textstring
xnumber
ynumber
maxWidth?number

Returns

void

Method

Implementation of

CanvasRenderingContext2D.fillText

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:728


fillTextPrecision()

fillTextPrecision(
   text, 
   x, 
   y, 
   maxWidth?): void

fillText function.

Parameters

ParameterType
textstring
xnumber
ynumber
maxWidth?number

Returns

void

Method

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:746


getBrowserType()

getBrowserType(): string

Returns

string

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:522


getContextAttributes()

getContextAttributes(): CanvasRenderingContext2DSettings

MDN Reference

Returns

CanvasRenderingContext2DSettings

Implementation of

CanvasRenderingContext2D.getContextAttributes

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:326


getId()

getId(): string

Returns

string

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:41


getImageData()

getImageData(
   sx, 
   sy, 
   sw, 
   sh): ImageData

getImageData function.

Parameters

ParameterType
sxnumber
synumber
swnumber
shnumber

Returns

ImageData

Method

Implementation of

CanvasRenderingContext2D.getImageData

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:772


getLineDash()

getLineDash(): number[]

getLineDash function.

Returns

number[]

Method

Implementation of

CanvasRenderingContext2D.getLineDash

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:919


getScale()

getScale(): {
  scaleX: number;
  scaleY: number;
}

Returns

{
  scaleX: number;
  scaleY: number;
}
NameTypeDefined in
scaleXnumberpackages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:317
scaleYnumberpackages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:318

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:322


getSystemType()

getSystemType(): string

Returns

string

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:515


getTransform()

getTransform(): DOMMatrix

MDN Reference

Returns

DOMMatrix

Implementation of

CanvasRenderingContext2D.getTransform

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:368


isContextLost()

isContextLost(): boolean

MDN Reference

Returns

boolean

Implementation of

CanvasRenderingContext2D.isContextLost

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:49


isPointInPath()

isPointInPath(x, y, fillRule)

isPointInPath(
   x, 
   y, 
   fillRule?): boolean

isPointInPath function.

Parameters
ParameterType
xnumber
ynumber
fillRule?CanvasFillRule
Returns

boolean

Method
Implementation of

CanvasRenderingContext2D.isPointInPath

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:658

isPointInPath(path, x, y, fillRule)

isPointInPath(
   path, 
   x, 
   y, 
   fillRule?): boolean
Parameters
ParameterType
pathPath2D
xnumber
ynumber
fillRule?CanvasFillRule
Returns

boolean

Implementation of

CanvasRenderingContext2D.isPointInPath

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:660


isPointInStroke()

isPointInStroke(x, y)

isPointInStroke(x, y): boolean

MDN Reference

Parameters
ParameterType
xnumber
ynumber
Returns

boolean

Implementation of

CanvasRenderingContext2D.isPointInStroke

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:330

isPointInStroke(path, x, y)

isPointInStroke(
   path, 
   x, 
   y): boolean
Parameters
ParameterType
pathPath2D
xnumber
ynumber
Returns

boolean

Implementation of

CanvasRenderingContext2D.isPointInStroke

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:332


lineTo()

lineTo(x, y): void

lineTo function.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.lineTo

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:780


lineToByPrecision()

lineToByPrecision(x, y): void

lineTo function precision.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Method

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:788


measureText()

measureText(text): TextMetrics

measureText function.

Parameters

ParameterType
textstring

Returns

TextMetrics

Method

Implementation of

CanvasRenderingContext2D.measureText

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:764


moveTo()

moveTo(x, y): void

moveTo function.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.moveTo

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:800


moveToByPrecision()

moveToByPrecision(x, y): void

moveTo function precision.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Method

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:808


moveToByPrecisionLog()

moveToByPrecisionLog(x, y): void

Parameters

ParameterType
xnumber
ynumber

Returns

void

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:815


putImageData()

putImageData(
   imageData, 
   dx, 
   dy): void

putImageData function.

Parameters

ParameterType
imageDataImageData
dxnumber
dynumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.putImageData

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:848


quadraticCurveTo()

quadraticCurveTo(
   cpx, 
   cpy, 
   x, 
   y): void

quadraticCurveTo function.

Parameters

ParameterType
cpxnumber
cpynumber
xnumber
ynumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.quadraticCurveTo

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:856


rect()

rect(
   x, 
   y, 
   width, 
   height): void

rect function.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.rect

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:826


rectByPrecision()

rectByPrecision(
   x, 
   y, 
   width, 
   height): void

rect function.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:834


reset()

reset(): void

reset canvas context transform

Returns

void

Method

Implementation of

CanvasRenderingContext2D.reset

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:388


resetTransform()

resetTransform(): void

MDN Reference

Returns

void

Implementation of

CanvasRenderingContext2D.resetTransform

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:373


restore()

restore(): void

restore function.

Returns

void

Method

Implementation of

CanvasRenderingContext2D.restore

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:864


rotate()

rotate(angle): void

rotate function.

Parameters

ParameterType
anglenumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.rotate

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:872


roundRect()

roundRect(
   x, 
   y, 
   w, 
   h, 
   radii?): void

MDN Reference

Parameters

ParameterType
xnumber
ynumber
wnumber
hnumber
radii?number | DOMPointInit | (number | DOMPointInit)[]

Returns

void

Implementation of

CanvasRenderingContext2D.roundRect

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:342


roundRectByPrecision()

roundRectByPrecision(
   x, 
   y, 
   w, 
   h, 
   radii?): void

Parameters

ParameterType
xnumber
ynumber
wnumber
hnumber
radii?number | DOMPointInit | (number | DOMPointInit)[]

Returns

void

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:352


save()

save(): void

save function.

Returns

void

Method

Implementation of

CanvasRenderingContext2D.save

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:881


scale()

scale(x, y): void

scale function.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.scale

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:889


setGlobalCompositeOperation()

setGlobalCompositeOperation(val): void

Parameters

ParameterType
valGlobalCompositeOperation

Returns

void

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:1007


setId()

setId(id): void

Parameters

ParameterType
idstring

Returns

void

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:45


setLineDash()

setLineDash(segments): void

setLineDash function.

Parameters

ParameterType
segmentsnumber[]

Returns

void

Method

Implementation of

CanvasRenderingContext2D.setLineDash

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:898


setLineWidthByPrecision()

setLineWidthByPrecision(val): void

Parameters

ParameterType
valnumber

Returns

void

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:153


setTransform()

setTransform(transform)

setTransform(transform?): void

setTransform function.

Parameters
ParameterType
transform?DOMMatrix2DInit
Returns

void

Method
Implementation of

CanvasRenderingContext2D.setTransform

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:927

setTransform(a, b, c, d, e, f)

setTransform(
   a, 
   b, 
   c, 
   d, 
   e, 
   f): void
Parameters
ParameterType
anumber
bnumber
cnumber
dnumber
enumber
fnumber
Returns

void

Implementation of

CanvasRenderingContext2D.setTransform

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:929


stroke()

stroke(path2d?): void

stroke function.

Parameters

ParameterType
path2d?Path2D

Returns

void

Method

Implementation of

CanvasRenderingContext2D.stroke

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:940


strokeRect()

strokeRect(
   x, 
   y, 
   width, 
   height): void

strokeRect function.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.strokeRect

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:706


strokeRectPrecision()

strokeRectPrecision(
   x, 
   y, 
   width, 
   height): void

strokeRect function precision.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:714


strokeText()

strokeText(
   text, 
   x, 
   y, 
   maxWidth?): void

strokeText function.

Parameters

ParameterType
textstring
xnumber
ynumber
maxWidth?number

Returns

void

Method

Implementation of

CanvasRenderingContext2D.strokeText

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:952


strokeTextByPrecision()

strokeTextByPrecision(
   text, 
   x, 
   y, 
   maxWidth?): void

strokeText function precision.

Parameters

ParameterType
textstring
xnumber
ynumber
maxWidth?number

Returns

void

Method

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:960


transform()

transform(
   a, 
   b, 
   c, 
   d, 
   e, 
   f): void

transform function.

Parameters

ParameterType
anumber
bnumber
cnumber
dnumber
enumber
fnumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.transform

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:975


translate()

translate(x, y): void

translate function.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Method

Implementation of

CanvasRenderingContext2D.translate

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:984


translateWithPrecision()

translateWithPrecision(x, y): void

Parameters

ParameterType
xnumber
ynumber

Returns

void

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:989


translateWithPrecisionRatio()

translateWithPrecisionRatio(x, y): void

Parameters

ParameterType
xnumber
ynumber

Returns

void

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/context.ts:997