Skip to content

Commit 75813f3

Browse files
committed
GPU-like pixel conversion
1 parent d034a70 commit 75813f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/pixel-conversion.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace msdfgen {
77

88
inline byte pixelFloatToByte(float x) {
9-
return byte(clamp(256.f*x, 255.f));
9+
return byte(~int(255.5f-255.f*clamp(x)));
1010
}
1111

1212
inline float pixelByteToFloat(byte x) {

0 commit comments

Comments
 (0)