Skip to content

Commit

Permalink
feat(troika-three-text): remove deprecated totalBounds/totalBlockSize…
Browse files Browse the repository at this point in the history
… properties from textRenderInfo
  • Loading branch information
lojjic committed Mar 21, 2022
1 parent b1f5d5c commit 2b87308
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions packages/troika-three-text/src/TextBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ const atlases = Object.create(null)
* equivalent to the dimensions of a block-level text element in CSS.
* @property {Array<number>} visibleBounds - The total [minX, minY, maxX, maxY] rect of the whole text block;
* unlike `blockBounds` this is tightly wrapped to the visible glyph paths.
* @property {Array<number>} totalBounds - DEPRECATED; use blockBounds instead.
* @property {Array<number>} totalBlockSize - DEPRECATED; use blockBounds instead
* @property {Array<object>} chunkedBounds - List of bounding rects for each consecutive set of N glyphs,
* in the format `{start:N, end:N, rect:[minX, minY, maxX, maxY]}`.
* @property {object} timings - Timing info for various parts of the rendering logic including SDF
Expand Down Expand Up @@ -275,15 +273,6 @@ function getTextRenderInfo(args, callback) {
blockBounds: result.blockBounds,
visibleBounds: result.visibleBounds,
timings: result.timings,
get totalBounds() {
console.log('totalBounds deprecated, use blockBounds instead')
return result.blockBounds
},
get totalBlockSize() {
console.log('totalBlockSize deprecated, use blockBounds instead')
const [x0, y0, x1, y1] = result.blockBounds
return [x1 - x0, y1 - y0]
}
}))
})
})
Expand Down
2 changes: 1 addition & 1 deletion packages/troika-three-text/src/Typesetter.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ export function createTypesetter(fontParser, bidi, config) {
anchorXOffset + maxLineWidth,
anchorYOffset
],
visibleBounds, //total bounds of visible text paths, may be larger or smaller than totalBounds
visibleBounds, //total bounds of visible text paths, may be larger or smaller than blockBounds
timings
})
})
Expand Down

0 comments on commit 2b87308

Please sign in to comment.