src/js/animations/Transition.js
// Therefore removeUnchanged should be always false. But is configurable.
Therefore removeUnchanged should be always false. But is configurable.
Therefore removeUnchanged should be always false . But is configurable .
calculateDiffKeyframes(source, target, properties = [], removeUnchanged = false) {
		var sourceBbox = source.getBoundingClientRect()
		var targetBbox = target.getBoundingClientRect()
		var sourceComputed
		var targetComputed
		var keyframes = {}
		for (let prop of properties) {
			if (prop in sourceBbox) {
				keyframes[prop] = [sourceBbox[prop] + 'px', targetBbox[prop] + 'px']
			} else {
				if (!sourceComputed) {
					sourceComputed = window.getComputedStyle(source)
					targetComputed = window.getComputedStyle(target)
				}
				if (prop === 'borderRadius') {
					keyframes.clipPath = [
						`inset(0px 0px 0px 0px round ${sourceComputed.borderRadius})`,
						`inset(0px 0px 0px 0px round ${targetComputed.borderRadius})`
					]
				} else {
					keyframes[prop] = [sourceComputed[prop], targetComputed[prop]]
				}
			}
			if (removeUnchanged) {
				let [val1, val2] = keyframes[prop]
				if (val1 === val2) delete keyframes[prop]
			}
		}
		return keyframes
	}
calculateDiffKeyframes ( source , target , properties = [ ] , removeUnchanged = false ) { var sourceBbox = source . getBoundingClientRect ( ) var targetBbox = target . getBoundingClientRect ( ) var sourceComputed var targetComputed var keyframes = { } for ( let prop of properties ) { if ( prop in sourceBbox ) { keyframes [ prop ] = [ sourceBbox [ prop ] + 'px' , targetBbox [ prop ] + 'px' ] } else { if ( ! sourceComputed ) { sourceComputed = window . getComputedStyle ( source ) targetComputed = window . getComputedStyle ( target ) } if ( prop === 'borderRadius' ) { keyframes . clipPath = [ ` ${ sourceComputed . borderRadius } ` , ` ${ targetComputed . borderRadius } ` ] } else { keyframes [ prop ] = [ sourceComputed [ prop ] , targetComputed [ prop ] ] } } if ( removeUnchanged ) { let [ val1 , val2 ] = keyframes [ prop ] if ( val1 === val2 ) delete keyframes [ prop ] } } return keyframes }
Therefore removeUnchanged should be always false.
Therefore removeUnchanged should be always false .
// Do not calculate computed styles untill necessary. It's expensive. // allow using translate instead of left/top positioning // TODO: disable this if using box-shadow (??? and overflow:hidden ???)