Просмотр исходного кода

BeginScissorMode checks for render texture to avoid using GetWindowScaleDPI (#3510)

pull/3512/head
gulrak 2 лет назад
committed by GitHub
Родитель
Сommit
56b5a5c4f0
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: 4AEE18F83AFDEB23
1 измененных файлов: 9 добавлений и 4 удалений
  1. +9
    -4
      src/rcore.c

+ 9
- 4
src/rcore.c Просмотреть файл

@ -1088,20 +1088,25 @@ void BeginScissorMode(int x, int y, int width, int height)
rlEnableScissorTest();
GLint id = 0;
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &id); // Test for render texture
#if defined(__APPLE__)
Vector2 scale = GetWindowScaleDPI();
rlScissor((int)(x*scale.x), (int)(GetScreenHeight()*scale.y - (((y + height)*scale.y))), (int)(width*scale.x), (int)(height*scale.y));
if(!id)
{
Vector2 scale = GetWindowScaleDPI();
rlScissor((int)(x*scale.x), (int)(GetScreenHeight()*scale.y - (((y + height)*scale.y))), (int)(width*scale.x), (int)(height*scale.y));
}
#else
if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0)
if (o">!id && (CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0)
{
Vector2 scale = GetWindowScaleDPI();
rlScissor((int)(x*scale.x), (int)(CORE.Window.currentFbo.height - (y + height)*scale.y), (int)(width*scale.x), (int)(height*scale.y));
}
#endif
else
{
rlScissor(x, CORE.Window.currentFbo.height - (y + height), width, height);
}
#endif
}
// End scissor mode

Загрузка…
Отмена
Сохранить