Prevent an infinite loop

This commit is contained in:
Jamie Wong 2018-04-05 00:41:49 -07:00
parent e4a6d2e3f3
commit 045be2831b

View File

@ -275,6 +275,11 @@ export class FlamechartRenderer {
// atlas line is higher resolution than its corresponding destination rectangle on
// the screen.
const configToPhysical = AffineTransform.betweenRects(configSpaceSrcRect, physicalSpaceDstRect)
if (configSpaceSrcRect.isEmpty()) {
// Prevent an infinite loop
return
}
let zoomLevel = 0
while (true) {
const configSpaceBounds = this.configSpaceBoundsForKey({ stackDepth: 0, zoomLevel, index: 0 })