소스 검색

Make LoadFontFromImage limit its scanning to image dimensions.

pull/5626/head
JoeStrout 1 주 전
부모
커밋
cb5d52bf2b
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. +4
    -2
      src/rtext.c

+ 4
- 2
src/rtext.c 파일 보기

@ -446,7 +446,8 @@ Font LoadFontFromImage(Image image, Color key, int firstChar)
int charHeight = 0;
int j = 0;
while (!COLOR_EQUAL(pixels[(lineSpacing + j)*image.width + charSpacing], key)) j++;
while ((lineSpacing + j) < image.height &&
!COLOR_EQUAL(pixels[(lineSpacing + j)*image.width + charSpacing], key)) j++;
charHeight = j;
@ -469,7 +470,8 @@ Font LoadFontFromImage(Image image, Color key, int firstChar)
int charWidth = 0;
while (!COLOR_EQUAL(pixels[(lineSpacing + (charHeight+lineSpacing)*lineToRead)*image.width + xPosToRead + charWidth], key)) charWidth++;
while ((xPosToRead + charWidth) < image.width &&
!COLOR_EQUAL(pixels[(lineSpacing + (charHeight+lineSpacing)*lineToRead)*image.width + xPosToRead + charWidth], key)) charWidth++;
tempCharRecs[index].width = (float)charWidth;

불러오는 중...
취소
저장