popmotion icon indicating copy to clipboard operation
popmotion copied to clipboard

[react-pose] Scaled text is blurry in demos

Open amcdnl opened this issue 7 years ago • 5 comments

Issue

On the demo page, if you look carefully at the interactive example when you hover you will notice the text is blurry.

img

This seems like a pretty common issue when doing transforms. Some people suggested setting the perspective property on the transform ( https://stackoverflow.com/questions/14677490/blurry-text-after-using-css-transform-scale-in-chrome ) but thats not possible given the component is overriding the transform.

Any suggestions/ideas?

amcdnl avatar Dec 05 '18 13:12 amcdnl

I think perspective would still bring up this issue because the reason these animations are performant is the element has already been rendered and sent to the GPU as a raster image.

The only way around it (this applies to CSS too) is to render at a higher resolution and scale down. In other words make the element larger to begin with and then set scale: 0.9 (for instance) as the smaller scale and scale: 1 as the larger scale On Wed, 5 Dec 2018 at 13:27, Austin [email protected] wrote:

Issue

On the demo page, if you look carefully at the interactive example when you hover you will notice the text is blurry.

[image: img] https://camo.githubusercontent.com/84b68dd5018b957715f0f74e72202d9c8d3085df/68747470733a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f616d6364616e69656c32322f666f6c646572732f536e616769742f6d656469612f32356664613266332d396464362d346236652d623761642d6338633765616661363262312f323031382d31322d30355f30372d32332d30362e706e67

This seems like a pretty common issue when doing transforms. Some people suggested setting the perspective property on the transform ( https://stackoverflow.com/questions/14677490/blurry-text-after-using-css-transform-scale-in-chrome ) but thats not possible given the component is overriding the transform.

Any suggestions/ideas?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Popmotion/popmotion/issues/660, or mute the thread https://github.com/notifications/unsubscribe-auth/AHfLKr-pmMLRnSwf6-8Dbcii4SERlPG0ks5u18nVgaJpZM4ZCuhU .

mattgperry avatar Dec 05 '18 13:12 mattgperry

Gotcha - Thanks for the info.

It would be nice if I could make just the container scale and not the contents.

amcdnl avatar Dec 05 '18 15:12 amcdnl

@InventingWithMonster - If you do will-change: transform; it removes the blur! :) - Might want to consider applying that automatically?

amcdnl avatar Dec 07 '18 13:12 amcdnl

@InventingWithMonster this also happens on react native. Performance is phenomenal when I use x or y to animate, but all text in the animated container becomes blurry as a result of it:

{
	slideUp: (end: number = 0, start: number = -500) => ({
		[Animations.Shown]: {
			y: end,
			transition: {
				delay: 50,
				duration: 350,
				useNativeDriver: true,
			},
		},
		[Animations.Hidden]: {
			y: start,
			transition: {
				delay: 50,
				duration: 350,
				useNativeDriver: true,
			},
		},
	})
	}

Aleksion avatar Feb 01 '19 11:02 Aleksion

Hi guys, I am facing a similar issue on react-native-pose. i am using Transitions in order to slide booking components one by one. Here is a short part of my code for you to understand better what i'm doing.

<Transition
    enterBookingFlow={this.state.enterBookingFlow}
    deltaIVProduct={this.state.widthSlideIVProduct} 
    deltaLocation={this.state.widthSlideLocation} 
    deltaTime={this.state.widthSlideTime}
    >
<BoxListProduct/>
{
          this.props.dataFlow.currentPage == 'Time'?
       <BoxTime
         key="d"
         onRef={ref => (this.timePicker = ref)}
         pose={this.state.showBookingFlow && this.props.dataFlow.currentPage == 'Time'? 'enter' : 'exit'}
         next={this.next.bind(this)}
         backTime={this.backTime.bind(this)}
        />
        :null
       }
</Transition>

And here is the result on my Time component, the native IOS picker is blurred and it looks like it is because of the transition component. Do you have any idea on how to fix it ? Simulator Screen Shot - iPhone X - 2019-04-07 at 12 14 49

Thanks very much in advance!

twillstudio avatar Apr 07 '19 02:04 twillstudio