diff --git a/src/canvas.class.js b/src/canvas.class.js index 055e78ae1a3..2df20ea4a24 100644 --- a/src/canvas.class.js +++ b/src/canvas.class.js @@ -492,6 +492,17 @@ * @return {Boolean} */ isTargetTransparent: function (target, x, y) { + if (target.shouldCache() && target._cacheCanvas && !target.isCacheDirty()) { + var normalizedPointer = this._normalizePointer(target, {x:x, y:y}), + targetRelativeX = target.cacheTranslationX + (normalizedPointer.x * target.zoomX), + targetRelativeY = target.cacheTranslationY + (normalizedPointer.y * target.zoomY); + + var isTransparent = fabric.util.isTransparent( + target._cacheContext, targetRelativeX, targetRelativeY, this.targetFindTolerance); + + return isTransparent; + } + var ctx = this.contextCache, originalColor = target.selectionBackgroundColor, v = this.viewportTransform;