rickytan / RTImageAssets

A Xcode plugin to automatically generate 2x, 1x image from 3x image for you, or upscale to 3x from 2x
MIT License
2.46k stars 334 forks source link

好像会有虚边 #99

Closed bartontang closed 7 years ago

bartontang commented 7 years ago

就是我用一个@3x的图,然后去生成@2x的图,然后我发现@2x的图会有虚边,当你把图放大看就明显了,直线部分,正常来说就应该不论怎么缩小都应该是那么长的直线,但生成的直线上下生成一个虚边在3倍图上是没有的哦~可以测试下

rickytan commented 7 years ago

直线变虚是可能的,如果在 3x 图上直线占了不能被 3 整除的线宽,缩小到 2x 一定会虚的,这种情况需要设计单独出图了。同样的情况也出现在 UIView 的 frame 设置上,如果你在 2x 屏上设置 frame = {{0.2, 0.2}, {100.6, 100.6}} ,borderWidth = 0.5,也会边界模糊的,因为屏幕无法在整数像素上绘制颜色

image

bartontang commented 7 years ago

Mark