API Reference
@univerjs
@univerjs/engine-render
classes
Univerrenderingcontext

@univerjs/engine-render v0.4.2Docs


Class: UniverRenderingContext

Extends

Constructors

new UniverRenderingContext()

new UniverRenderingContext(context): UniverRenderingContext

Parameters

ParameterType
contextCanvasRenderingContext2D

Returns

UniverRenderingContext

Inherited from

UniverRenderingContext2D.constructor

Defined in

submodules/univer/packages/engine-render/src/context.ts:34 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
__modepublicstring'rendering'-UniverRenderingContext2D.__modesubmodules/univer/packages/engine-render/src/context.ts:23 (opens in a new tab)
_contextpublicCanvasRenderingContext2Dundefined-UniverRenderingContext2D._contextsubmodules/univer/packages/engine-render/src/context.ts:28 (opens in a new tab)
canvasreadonlyHTMLCanvasElementundefinedMDN Reference (opens in a new tab)UniverRenderingContext2D.canvassubmodules/univer/packages/engine-render/src/context.ts:26 (opens in a new tab)
renderConfigpublicReadonly<IRenderConfig>{}-UniverRenderingContext2D.renderConfigsubmodules/univer/packages/engine-render/src/context.ts:32 (opens in a new tab)

Accessors

direction

get direction(): CanvasDirection

MDN Reference (opens in a new tab)

set direction(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valCanvasDirection

Returns

CanvasDirection

Inherited from

UniverRenderingContext2D.direction

Defined in

submodules/univer/packages/engine-render/src/context.ts:205 (opens in a new tab)


fillStyle

get fillStyle(): string | CanvasGradient | CanvasPattern

MDN Reference (opens in a new tab)

set fillStyle(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valstring | CanvasGradient | CanvasPattern

Returns

string | CanvasGradient | CanvasPattern

Inherited from

UniverRenderingContext2D.fillStyle

Defined in

submodules/univer/packages/engine-render/src/context.ts:73 (opens in a new tab)


filter

get filter(): string

MDN Reference (opens in a new tab)

set filter(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valstring

Returns

string

Inherited from

UniverRenderingContext2D.filter

Defined in

submodules/univer/packages/engine-render/src/context.ts:91 (opens in a new tab)


font

get font(): string

MDN Reference (opens in a new tab)

set font(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valstring

Returns

string

Inherited from

UniverRenderingContext2D.font

Defined in

submodules/univer/packages/engine-render/src/context.ts:214 (opens in a new tab)


fontKerning

get fontKerning(): CanvasFontKerning

MDN Reference (opens in a new tab)

set fontKerning(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valCanvasFontKerning

Returns

CanvasFontKerning

Inherited from

UniverRenderingContext2D.fontKerning

Defined in

submodules/univer/packages/engine-render/src/context.ts:223 (opens in a new tab)


fontStretch

get fontStretch(): CanvasFontStretch

MDN Reference (opens in a new tab)

set fontStretch(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valCanvasFontStretch

Returns

CanvasFontStretch

Inherited from

UniverRenderingContext2D.fontStretch

Defined in

submodules/univer/packages/engine-render/src/context.ts:232 (opens in a new tab)


fontVariantCaps

get fontVariantCaps(): CanvasFontVariantCaps

MDN Reference (opens in a new tab)

set fontVariantCaps(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valCanvasFontVariantCaps

Returns

CanvasFontVariantCaps

Inherited from

UniverRenderingContext2D.fontVariantCaps

Defined in

submodules/univer/packages/engine-render/src/context.ts:243 (opens in a new tab)


globalAlpha

get globalAlpha(): number

MDN Reference (opens in a new tab)

set globalAlpha(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valnumber

Returns

number

Inherited from

UniverRenderingContext2D.globalAlpha

Defined in

submodules/univer/packages/engine-render/src/context.ts:55 (opens in a new tab)


globalCompositeOperation

get globalCompositeOperation(): GlobalCompositeOperation

MDN Reference (opens in a new tab)

set globalCompositeOperation(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valGlobalCompositeOperation

Returns

GlobalCompositeOperation

Inherited from

UniverRenderingContext2D.globalCompositeOperation

Defined in

submodules/univer/packages/engine-render/src/context.ts:64 (opens in a new tab)


imageSmoothingEnabled

get imageSmoothingEnabled(): boolean

MDN Reference (opens in a new tab)

set imageSmoothingEnabled(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valboolean

Returns

boolean

Inherited from

UniverRenderingContext2D.imageSmoothingEnabled

Defined in

submodules/univer/packages/engine-render/src/context.ts:100 (opens in a new tab)


imageSmoothingQuality

get imageSmoothingQuality(): ImageSmoothingQuality

MDN Reference (opens in a new tab)

set imageSmoothingQuality(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valImageSmoothingQuality

Returns

ImageSmoothingQuality

Inherited from

UniverRenderingContext2D.imageSmoothingQuality

Defined in

submodules/univer/packages/engine-render/src/context.ts:109 (opens in a new tab)


letterSpacing

get letterSpacing(): string

MDN Reference (opens in a new tab)

set letterSpacing(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valstring

Returns

string

Inherited from

UniverRenderingContext2D.letterSpacing

Defined in

submodules/univer/packages/engine-render/src/context.ts:254 (opens in a new tab)


lineCap

get lineCap(): CanvasLineCap

MDN Reference (opens in a new tab)

set lineCap(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valCanvasLineCap

Returns

CanvasLineCap

Inherited from

UniverRenderingContext2D.lineCap

Defined in

submodules/univer/packages/engine-render/src/context.ts:118 (opens in a new tab)


lineDashOffset

get lineDashOffset(): number

MDN Reference (opens in a new tab)

set lineDashOffset(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valnumber

Returns

number

Inherited from

UniverRenderingContext2D.lineDashOffset

Defined in

submodules/univer/packages/engine-render/src/context.ts:127 (opens in a new tab)


lineJoin

get lineJoin(): CanvasLineJoin

MDN Reference (opens in a new tab)

set lineJoin(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valCanvasLineJoin

Returns

CanvasLineJoin

Inherited from

UniverRenderingContext2D.lineJoin

Defined in

submodules/univer/packages/engine-render/src/context.ts:136 (opens in a new tab)


lineWidth

get lineWidth(): number

MDN Reference (opens in a new tab)

set lineWidth(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valnumber

Returns

number

Inherited from

UniverRenderingContext2D.lineWidth

Defined in

submodules/univer/packages/engine-render/src/context.ts:145 (opens in a new tab)


miterLimit

get miterLimit(): number

MDN Reference (opens in a new tab)

set miterLimit(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valnumber

Returns

number

Inherited from

UniverRenderingContext2D.miterLimit

Defined in

submodules/univer/packages/engine-render/src/context.ts:160 (opens in a new tab)


shadowBlur

get shadowBlur(): number

MDN Reference (opens in a new tab)

set shadowBlur(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valnumber

Returns

number

Inherited from

UniverRenderingContext2D.shadowBlur

Defined in

submodules/univer/packages/engine-render/src/context.ts:169 (opens in a new tab)


shadowColor

get shadowColor(): string

MDN Reference (opens in a new tab)

set shadowColor(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valstring

Returns

string

Inherited from

UniverRenderingContext2D.shadowColor

Defined in

submodules/univer/packages/engine-render/src/context.ts:178 (opens in a new tab)


shadowOffsetX

get shadowOffsetX(): number

MDN Reference (opens in a new tab)

set shadowOffsetX(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valnumber

Returns

number

Inherited from

UniverRenderingContext2D.shadowOffsetX

Defined in

submodules/univer/packages/engine-render/src/context.ts:187 (opens in a new tab)


shadowOffsetY

get shadowOffsetY(): number

MDN Reference (opens in a new tab)

set shadowOffsetY(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valnumber

Returns

number

Inherited from

UniverRenderingContext2D.shadowOffsetY

Defined in

submodules/univer/packages/engine-render/src/context.ts:196 (opens in a new tab)


strokeStyle

get strokeStyle(): string | CanvasGradient | CanvasPattern

MDN Reference (opens in a new tab)

set strokeStyle(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valstring | CanvasGradient | CanvasPattern

Returns

string | CanvasGradient | CanvasPattern

Inherited from

UniverRenderingContext2D.strokeStyle

Defined in

submodules/univer/packages/engine-render/src/context.ts:82 (opens in a new tab)


textAlign

get textAlign(): CanvasTextAlign

MDN Reference (opens in a new tab)

set textAlign(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valCanvasTextAlign

Returns

CanvasTextAlign

Inherited from

UniverRenderingContext2D.textAlign

Defined in

submodules/univer/packages/engine-render/src/context.ts:287 (opens in a new tab)


textBaseline

get textBaseline(): CanvasTextBaseline

MDN Reference (opens in a new tab)

set textBaseline(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valCanvasTextBaseline

Returns

CanvasTextBaseline

Inherited from

UniverRenderingContext2D.textBaseline

Defined in

submodules/univer/packages/engine-render/src/context.ts:296 (opens in a new tab)


textRendering

get textRendering(): CanvasTextRendering

MDN Reference (opens in a new tab)

set textRendering(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valCanvasTextRendering

Returns

CanvasTextRendering

Inherited from

UniverRenderingContext2D.textRendering

Defined in

submodules/univer/packages/engine-render/src/context.ts:265 (opens in a new tab)


wordSpacing

get wordSpacing(): string

MDN Reference (opens in a new tab)

set wordSpacing(val): void

MDN Reference (opens in a new tab)

Parameters

ParameterType
valstring

Returns

string

Inherited from

UniverRenderingContext2D.wordSpacing

Defined in

submodules/univer/packages/engine-render/src/context.ts:276 (opens in a new tab)

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
scaleXnumbersubmodules/univer/packages/engine-render/src/context.ts:317 (opens in a new tab)
scaleYnumbersubmodules/univer/packages/engine-render/src/context.ts:318 (opens in a new tab)

Inherited from

UniverRenderingContext2D._getScale

Defined in

submodules/univer/packages/engine-render/src/context.ts:308 (opens in a new tab)


arc()

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

arc function.

Parameters

ParameterType
xnumber
ynumber
radiusnumber
startAnglenumber
endAnglenumber
counterClockwise?boolean

Returns

void

Method

Inherited from

UniverRenderingContext2D.arc

Defined in

submodules/univer/packages/engine-render/src/context.ts:397 (opens in a new tab)


arcByPrecision()

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

arc function.

Parameters

ParameterType
xnumber
ynumber
radiusnumber
startAnglenumber
endAnglenumber
counterClockwise?boolean

Returns

void

Method

Inherited from

UniverRenderingContext2D.arcByPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:405 (opens in a new tab)


arcTo()

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

arcTo function.

Parameters

ParameterType
x1number
y1number
x2number
y2number
radiusnumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.arcTo

Defined in

submodules/univer/packages/engine-render/src/context.ts:418 (opens in a new tab)


arcToByPrecision()

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

arcTo function.

Parameters

ParameterType
x1number
y1number
x2number
y2number
radiusnumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.arcToByPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:427 (opens in a new tab)


beginPath()

beginPath(): void

beginPath function.

Returns

void

Method

Inherited from

UniverRenderingContext2D.beginPath

Defined in

submodules/univer/packages/engine-render/src/context.ts:441 (opens in a new tab)


bezierCurveTo()

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

bezierCurveTo function.

Parameters

ParameterType
cp1xnumber
cp1ynumber
cp2xnumber
cp2ynumber
xnumber
ynumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.bezierCurveTo

Defined in

submodules/univer/packages/engine-render/src/context.ts:449 (opens in a new tab)


bezierCurveToByPrecision()

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

bezierCurveTo function precision.

Parameters

ParameterType
cp1xnumber
cp1ynumber
cp2xnumber
cp2ynumber
xnumber
ynumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.bezierCurveToByPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:457 (opens in a new tab)


clearRect()

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

clearRect function.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.clearRect

Defined in

submodules/univer/packages/engine-render/src/context.ts:473 (opens in a new tab)


clearRectByPrecision()

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

clearRect function.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.clearRectByPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:481 (opens in a new tab)


clearRectForTexture()

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

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Inherited from

UniverRenderingContext2D.clearRectForTexture

Defined in

submodules/univer/packages/engine-render/src/context.ts:1003 (opens in a new tab)


clip()

clip(undefined)

clip(): void

clip function.

Returns

void

Method
Inherited from

UniverRenderingContext2D.clip

Defined in

submodules/univer/packages/engine-render/src/context.ts:495 (opens in a new tab)

clip(path)

clip(path): void

MDN Reference (opens in a new tab)

Parameters
ParameterType
pathPath2D
Returns

void

Inherited from

UniverRenderingContext2D.clip

Defined in

submodules/univer/packages/engine-render/src/context.ts:497 (opens in a new tab)

clip(fillRule)

clip(fillRule?): void

MDN Reference (opens in a new tab)

Parameters
ParameterType
fillRule?CanvasFillRule
Returns

void

Inherited from

UniverRenderingContext2D.clip

Defined in

submodules/univer/packages/engine-render/src/context.ts:499 (opens in a new tab)

clip(path, fillRule)

clip(path, fillRule?): void

MDN Reference (opens in a new tab)

Parameters
ParameterType
pathPath2D
fillRule?CanvasFillRule
Returns

void

Inherited from

UniverRenderingContext2D.clip

Defined in

submodules/univer/packages/engine-render/src/context.ts:501 (opens in a new tab)


closePath()

closePath(): void

closePath function.

Returns

void

Method

Inherited from

UniverRenderingContext2D.closePath

Defined in

submodules/univer/packages/engine-render/src/context.ts:511 (opens in a new tab)


closePathByEnv()

closePathByEnv(): void

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

Returns

void

Inherited from

UniverRenderingContext2D.closePathByEnv

Defined in

submodules/univer/packages/engine-render/src/context.ts:532 (opens in a new tab)


createConicGradient()

createConicGradient(
   startAngle, 
   x, 
   y): CanvasGradient

MDN Reference (opens in a new tab)

Parameters

ParameterType
startAnglenumber
xnumber
ynumber

Returns

CanvasGradient

Inherited from

UniverRenderingContext2D.createConicGradient

Defined in

submodules/univer/packages/engine-render/src/context.ts:338 (opens in a new tab)


createImageData()

createImageData(width, height, settings)

createImageData(
   width, 
   height, 
   settings?): ImageData

createImageData function.

Parameters
ParameterType
widthnumber
heightnumber
settings?ImageDataSettings
Returns

ImageData

Method
Inherited from

UniverRenderingContext2D.createImageData

Defined in

submodules/univer/packages/engine-render/src/context.ts:549 (opens in a new tab)

createImageData(imagedata)

createImageData(imagedata): ImageData

MDN Reference (opens in a new tab)

Parameters
ParameterType
imagedataImageData
Returns

ImageData

Inherited from

UniverRenderingContext2D.createImageData

Defined in

submodules/univer/packages/engine-render/src/context.ts:551 (opens in a new tab)


createLinearGradient()

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

createLinearGradient function.

Parameters

ParameterType
x0number
y0number
x1number
y1number

Returns

CanvasGradient

Method

Inherited from

UniverRenderingContext2D.createLinearGradient

Defined in

submodules/univer/packages/engine-render/src/context.ts:570 (opens in a new tab)


createPattern()

createPattern(image, repetition): null | CanvasPattern

createPattern function.

Parameters

ParameterType
imageCanvasImageSource
repetitionnull | string

Returns

null | CanvasPattern

Method

Inherited from

UniverRenderingContext2D.createPattern

Defined in

submodules/univer/packages/engine-render/src/context.ts:578 (opens in a new tab)


createRadialGradient()

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

createRadialGradient function.

Parameters

ParameterType
x0number
y0number
r0number
x1number
y1number
r1number

Returns

CanvasGradient

Method

Inherited from

UniverRenderingContext2D.createRadialGradient

Defined in

submodules/univer/packages/engine-render/src/context.ts:586 (opens in a new tab)


drawFocusIfNeeded()

drawFocusIfNeeded(element)

drawFocusIfNeeded(element): void

MDN Reference (opens in a new tab)

Parameters
ParameterType
elementElement
Returns

void

Inherited from

UniverRenderingContext2D.drawFocusIfNeeded

Defined in

submodules/univer/packages/engine-render/src/context.ts:378 (opens in a new tab)

drawFocusIfNeeded(path, element)

drawFocusIfNeeded(path, element): void

MDN Reference (opens in a new tab)

Parameters
ParameterType
pathPath2D
elementElement
Returns

void

Inherited from

UniverRenderingContext2D.drawFocusIfNeeded

Defined in

submodules/univer/packages/engine-render/src/context.ts:379 (opens in a new tab)


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

Inherited from

UniverRenderingContext2D.drawImage

Defined in

submodules/univer/packages/engine-render/src/context.ts:594 (opens in a new tab)


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

Inherited from

UniverRenderingContext2D.ellipse

Defined in

submodules/univer/packages/engine-render/src/context.ts:634 (opens in a new tab)


fill()

fill(fillRule)

fill(fillRule?): void

fill function.

Parameters
ParameterType
fillRule?CanvasFillRule
Returns

void

Method
Inherited from

UniverRenderingContext2D.fill

Defined in

submodules/univer/packages/engine-render/src/context.ts:670 (opens in a new tab)

fill(path, fillRule)

fill(path, fillRule?): void

MDN Reference (opens in a new tab)

Parameters
ParameterType
pathPath2D
fillRule?CanvasFillRule
Returns

void

Inherited from

UniverRenderingContext2D.fill

Defined in

submodules/univer/packages/engine-render/src/context.ts:672 (opens in a new tab)


fillRect()

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

fillRect function.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.fillRect

Defined in

submodules/univer/packages/engine-render/src/context.ts:684 (opens in a new tab)


fillRectByPrecision()

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

fillRect function precision.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.fillRectByPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:692 (opens in a new tab)


fillText()

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

fillText function.

Parameters

ParameterType
textstring
xnumber
ynumber
maxWidth?number

Returns

void

Method

Inherited from

UniverRenderingContext2D.fillText

Defined in

submodules/univer/packages/engine-render/src/context.ts:728 (opens in a new tab)


fillTextPrecision()

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

fillText function.

Parameters

ParameterType
textstring
xnumber
ynumber
maxWidth?number

Returns

void

Method

Inherited from

UniverRenderingContext2D.fillTextPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:746 (opens in a new tab)


getBrowserType()

getBrowserType(): string

Returns

string

Inherited from

UniverRenderingContext2D.getBrowserType

Defined in

submodules/univer/packages/engine-render/src/context.ts:522 (opens in a new tab)


getContextAttributes()

getContextAttributes(): CanvasRenderingContext2DSettings

MDN Reference (opens in a new tab)

Returns

CanvasRenderingContext2DSettings

Inherited from

UniverRenderingContext2D.getContextAttributes

Defined in

submodules/univer/packages/engine-render/src/context.ts:326 (opens in a new tab)


getId()

getId(): string

Returns

string

Inherited from

UniverRenderingContext2D.getId

Defined in

submodules/univer/packages/engine-render/src/context.ts:41 (opens in a new tab)


getImageData()

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

getImageData function.

Parameters

ParameterType
sxnumber
synumber
swnumber
shnumber

Returns

ImageData

Method

Inherited from

UniverRenderingContext2D.getImageData

Defined in

submodules/univer/packages/engine-render/src/context.ts:772 (opens in a new tab)


getLineDash()

getLineDash(): number[]

getLineDash function.

Returns

number[]

Method

Inherited from

UniverRenderingContext2D.getLineDash

Defined in

submodules/univer/packages/engine-render/src/context.ts:919 (opens in a new tab)


getScale()

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

Returns

{
  scaleX: number;
  scaleY: number;
}
NameTypeDefined in
scaleXnumbersubmodules/univer/packages/engine-render/src/context.ts:317 (opens in a new tab)
scaleYnumbersubmodules/univer/packages/engine-render/src/context.ts:318 (opens in a new tab)

Inherited from

UniverRenderingContext2D.getScale

Defined in

submodules/univer/packages/engine-render/src/context.ts:322 (opens in a new tab)


getSystemType()

getSystemType(): string

Returns

string

Inherited from

UniverRenderingContext2D.getSystemType

Defined in

submodules/univer/packages/engine-render/src/context.ts:515 (opens in a new tab)


getTransform()

getTransform(): DOMMatrix

MDN Reference (opens in a new tab)

Returns

DOMMatrix

Inherited from

UniverRenderingContext2D.getTransform

Defined in

submodules/univer/packages/engine-render/src/context.ts:368 (opens in a new tab)


isContextLost()

isContextLost(): boolean

Returns

boolean

Inherited from

UniverRenderingContext2D.isContextLost

Defined in

submodules/univer/packages/engine-render/src/context.ts:49 (opens in a new tab)


isPointInPath()

isPointInPath(x, y, fillRule)

isPointInPath(
   x, 
   y, 
   fillRule?): boolean

isPointInPath function.

Parameters
ParameterType
xnumber
ynumber
fillRule?CanvasFillRule
Returns

boolean

Method
Inherited from

UniverRenderingContext2D.isPointInPath

Defined in

submodules/univer/packages/engine-render/src/context.ts:658 (opens in a new tab)

isPointInPath(path, x, y, fillRule)

isPointInPath(
   path, 
   x, 
   y, 
   fillRule?): boolean

MDN Reference (opens in a new tab)

Parameters
ParameterType
pathPath2D
xnumber
ynumber
fillRule?CanvasFillRule
Returns

boolean

Inherited from

UniverRenderingContext2D.isPointInPath

Defined in

submodules/univer/packages/engine-render/src/context.ts:660 (opens in a new tab)


isPointInStroke()

isPointInStroke(x, y)

isPointInStroke(x, y): boolean

MDN Reference (opens in a new tab)

Parameters
ParameterType
xnumber
ynumber
Returns

boolean

Inherited from

UniverRenderingContext2D.isPointInStroke

Defined in

submodules/univer/packages/engine-render/src/context.ts:330 (opens in a new tab)

isPointInStroke(path, x, y)

isPointInStroke(
   path, 
   x, 
   y): boolean

MDN Reference (opens in a new tab)

Parameters
ParameterType
pathPath2D
xnumber
ynumber
Returns

boolean

Inherited from

UniverRenderingContext2D.isPointInStroke

Defined in

submodules/univer/packages/engine-render/src/context.ts:332 (opens in a new tab)


lineTo()

lineTo(x, y): void

lineTo function.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.lineTo

Defined in

submodules/univer/packages/engine-render/src/context.ts:780 (opens in a new tab)


lineToByPrecision()

lineToByPrecision(x, y): void

lineTo function precision.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.lineToByPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:788 (opens in a new tab)


measureText()

measureText(text): TextMetrics

measureText function.

Parameters

ParameterType
textstring

Returns

TextMetrics

Method

Inherited from

UniverRenderingContext2D.measureText

Defined in

submodules/univer/packages/engine-render/src/context.ts:764 (opens in a new tab)


moveTo()

moveTo(x, y): void

moveTo function.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.moveTo

Defined in

submodules/univer/packages/engine-render/src/context.ts:800 (opens in a new tab)


moveToByPrecision()

moveToByPrecision(x, y): void

moveTo function precision.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.moveToByPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:808 (opens in a new tab)


moveToByPrecisionLog()

moveToByPrecisionLog(x, y): void

Parameters

ParameterType
xnumber
ynumber

Returns

void

Inherited from

UniverRenderingContext2D.moveToByPrecisionLog

Defined in

submodules/univer/packages/engine-render/src/context.ts:815 (opens in a new tab)


putImageData()

putImageData(
   imageData, 
   dx, 
   dy): void

putImageData function.

Parameters

ParameterType
imageDataImageData
dxnumber
dynumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.putImageData

Defined in

submodules/univer/packages/engine-render/src/context.ts:848 (opens in a new tab)


quadraticCurveTo()

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

quadraticCurveTo function.

Parameters

ParameterType
cpxnumber
cpynumber
xnumber
ynumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.quadraticCurveTo

Defined in

submodules/univer/packages/engine-render/src/context.ts:856 (opens in a new tab)


rect()

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

rect function.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.rect

Defined in

submodules/univer/packages/engine-render/src/context.ts:826 (opens in a new tab)


rectByPrecision()

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

rect function.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.rectByPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:834 (opens in a new tab)


reset()

reset(): void

reset canvas context transform

Returns

void

Method

Inherited from

UniverRenderingContext2D.reset

Defined in

submodules/univer/packages/engine-render/src/context.ts:388 (opens in a new tab)


resetTransform()

resetTransform(): void

MDN Reference (opens in a new tab)

Returns

void

Inherited from

UniverRenderingContext2D.resetTransform

Defined in

submodules/univer/packages/engine-render/src/context.ts:373 (opens in a new tab)


restore()

restore(): void

restore function.

Returns

void

Method

Inherited from

UniverRenderingContext2D.restore

Defined in

submodules/univer/packages/engine-render/src/context.ts:864 (opens in a new tab)


rotate()

rotate(angle): void

rotate function.

Parameters

ParameterType
anglenumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.rotate

Defined in

submodules/univer/packages/engine-render/src/context.ts:872 (opens in a new tab)


roundRect()

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

MDN Reference (opens in a new tab)

Parameters

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

Returns

void

Inherited from

UniverRenderingContext2D.roundRect

Defined in

submodules/univer/packages/engine-render/src/context.ts:342 (opens in a new tab)


roundRectByPrecision()

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

Parameters

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

Returns

void

Inherited from

UniverRenderingContext2D.roundRectByPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:352 (opens in a new tab)


save()

save(): void

save function.

Returns

void

Method

Inherited from

UniverRenderingContext2D.save

Defined in

submodules/univer/packages/engine-render/src/context.ts:881 (opens in a new tab)


scale()

scale(x, y): void

scale function.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.scale

Defined in

submodules/univer/packages/engine-render/src/context.ts:889 (opens in a new tab)


setGlobalCompositeOperation()

setGlobalCompositeOperation(val): void

Parameters

ParameterType
valGlobalCompositeOperation

Returns

void

Inherited from

UniverRenderingContext2D.setGlobalCompositeOperation

Defined in

submodules/univer/packages/engine-render/src/context.ts:1007 (opens in a new tab)


setId()

setId(id): void

Parameters

ParameterType
idstring

Returns

void

Inherited from

UniverRenderingContext2D.setId

Defined in

submodules/univer/packages/engine-render/src/context.ts:45 (opens in a new tab)


setLineDash()

setLineDash(segments): void

setLineDash function.

Parameters

ParameterType
segmentsnumber[]

Returns

void

Method

Inherited from

UniverRenderingContext2D.setLineDash

Defined in

submodules/univer/packages/engine-render/src/context.ts:898 (opens in a new tab)


setLineWidthByPrecision()

setLineWidthByPrecision(val): void

Parameters

ParameterType
valnumber

Returns

void

Inherited from

UniverRenderingContext2D.setLineWidthByPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:153 (opens in a new tab)


setTransform()

setTransform(transform)

setTransform(transform?): void

setTransform function.

Parameters
ParameterType
transform?DOMMatrix2DInit
Returns

void

Method
Inherited from

UniverRenderingContext2D.setTransform

Defined in

submodules/univer/packages/engine-render/src/context.ts:927 (opens in a new tab)

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

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

MDN Reference (opens in a new tab)

Parameters
ParameterType
anumber
bnumber
cnumber
dnumber
enumber
fnumber
Returns

void

Inherited from

UniverRenderingContext2D.setTransform

Defined in

submodules/univer/packages/engine-render/src/context.ts:929 (opens in a new tab)


stroke()

stroke(path2d?): void

stroke function.

Parameters

ParameterType
path2d?Path2D

Returns

void

Method

Inherited from

UniverRenderingContext2D.stroke

Defined in

submodules/univer/packages/engine-render/src/context.ts:940 (opens in a new tab)


strokeRect()

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

strokeRect function.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.strokeRect

Defined in

submodules/univer/packages/engine-render/src/context.ts:706 (opens in a new tab)


strokeRectPrecision()

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

strokeRect function precision.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.strokeRectPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:714 (opens in a new tab)


strokeText()

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

strokeText function.

Parameters

ParameterType
textstring
xnumber
ynumber
maxWidth?number

Returns

void

Method

Inherited from

UniverRenderingContext2D.strokeText

Defined in

submodules/univer/packages/engine-render/src/context.ts:952 (opens in a new tab)


strokeTextByPrecision()

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

strokeText function precision.

Parameters

ParameterType
textstring
xnumber
ynumber
maxWidth?number

Returns

void

Method

Inherited from

UniverRenderingContext2D.strokeTextByPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:960 (opens in a new tab)


transform()

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

transform function.

Parameters

ParameterType
anumber
bnumber
cnumber
dnumber
enumber
fnumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.transform

Defined in

submodules/univer/packages/engine-render/src/context.ts:975 (opens in a new tab)


translate()

translate(x, y): void

translate function.

Parameters

ParameterType
xnumber
ynumber

Returns

void

Method

Inherited from

UniverRenderingContext2D.translate

Defined in

submodules/univer/packages/engine-render/src/context.ts:984 (opens in a new tab)


translateWithPrecision()

translateWithPrecision(x, y): void

Parameters

ParameterType
xnumber
ynumber

Returns

void

Inherited from

UniverRenderingContext2D.translateWithPrecision

Defined in

submodules/univer/packages/engine-render/src/context.ts:989 (opens in a new tab)


translateWithPrecisionRatio()

translateWithPrecisionRatio(x, y): void

Parameters

ParameterType
xnumber
ynumber

Returns

void

Inherited from

UniverRenderingContext2D.translateWithPrecisionRatio

Defined in

submodules/univer/packages/engine-render/src/context.ts:997 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.