Fix group opacity (#1997)
@SomeHats I'll leave this assigned to you in case you want to compare the perf of using consts/lets scoped to the visitor function. Or just do that anyway regardless of microperf. Either is fine with me.
This commit is contained in:
parent
2694a7ab48
commit
a635145f2a
1 changed files with 2 additions and 3 deletions
|
@ -3026,17 +3026,16 @@ export class Editor extends EventEmitter<TLEventMap> {
|
||||||
const isCullingOffScreenShapes = Number.isFinite(this.renderingBoundsMargin)
|
const isCullingOffScreenShapes = Number.isFinite(this.renderingBoundsMargin)
|
||||||
|
|
||||||
let shape: TLShape | undefined
|
let shape: TLShape | undefined
|
||||||
let opacity: number
|
|
||||||
let isShapeErasing: boolean
|
let isShapeErasing: boolean
|
||||||
let isCulled: boolean
|
let isCulled: boolean
|
||||||
let util: ShapeUtil
|
let util: ShapeUtil
|
||||||
let maskedPageBounds: Box2d | undefined
|
let maskedPageBounds: Box2d | undefined
|
||||||
|
|
||||||
const addShapeById = (id: TLShapeId, parentOpacity: number, isAncestorErasing: boolean) => {
|
const addShapeById = (id: TLShapeId, opacity: number, isAncestorErasing: boolean) => {
|
||||||
shape = this.getShape(id)
|
shape = this.getShape(id)
|
||||||
if (!shape) return
|
if (!shape) return
|
||||||
|
|
||||||
opacity = shape.opacity * parentOpacity
|
opacity *= shape.opacity
|
||||||
isShapeErasing = false
|
isShapeErasing = false
|
||||||
isCulled = false
|
isCulled = false
|
||||||
util = this.getShapeUtil(shape)
|
util = this.getShapeUtil(shape)
|
||||||
|
|
Loading…
Reference in a new issue