Fix colors incorrect when rendering directly to buf
This commit is contained in:
parent
98d8ab2953
commit
0999ce159e
1 changed files with 6 additions and 0 deletions
|
|
@ -301,6 +301,12 @@
|
|||
CTFontDrawGlyphs(font, &glyph, &CGPointZero, 1, ctx);
|
||||
CGContextRelease(ctx);
|
||||
CGColorSpaceRelease(color_space);
|
||||
for (size_t r = 0; r < width; r++) {
|
||||
for (size_t c = 0; c < height; c++, buf += 4) {
|
||||
uint32_t px = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
|
||||
*((pixel*)buf) = px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue