index f9cbf3c01bde5919959d87e6f94de173251b8be1..0580a475a60f68178a479bf0f942162173155026 100644 (file)
--- a/src/game/g_holmes_ui.inc
+++ b/src/game/g_holmes_ui.inc
procedure THControl.setScissorGLInternal (x, y, w, h: Integer);
begin
if not scallowed then exit;
+ x := trunc(x*g_holmes_ui_scale);
+ y := trunc(y*g_holmes_ui_scale);
+ w := trunc(w*g_holmes_ui_scale);
+ h := trunc(h*g_holmes_ui_scale);
y := gWinSizeY-(y+h);
if not intersectRect(x, y, w, h, scxywh[0], scxywh[1], scxywh[2], scxywh[3]) then glScissor(0, 0, 0, 0) else glScissor(x, y, w, h);
end;
begin
if (mWidth > 0) and (mHeight > 0) then
begin
- mX := (gWinSizeX-mWidth) div 2;
- mY := (gWinSizeY-mHeight) div 2;
+ mX := trunc((gWinSizeX/g_holmes_ui_scale-mWidth)/2);
+ mY := trunc((gWinSizeY/g_holmes_ui_scale-mHeight)/2);
end;
end;
begin
if mDragging then
begin
- drawRect(mX+4, mY+4, mWidth-8, mHeight-8, r, g, b);
+ drawRectUI(mX+4, mY+4, mWidth-8, mHeight-8, r, g, b);
end
else
begin
- drawRect(mX+3, mY+3, mWidth-6, mHeight-6, r, g, b);
- drawRect(mX+5, mY+5, mWidth-10, mHeight-10, r, g, b);
+ drawRectUI(mX+3, mY+3, mWidth-6, mHeight-6, r, g, b);
+ drawRectUI(mX+5, mY+5, mWidth-10, mHeight-10, r, g, b);
setScissor(mFrameWidth, 0, 3*8, 8);
fillRect(mX+mFrameWidth, mY, 3*8, 8, 0, 0, 128);
drawText8(mX+mFrameWidth, mY, '[ ]', r, g, b);
if (Length(mTitle) > 0) then
begin
setScissor(mFrameWidth+3*8, 0, mWidth-mFrameWidth*2-3*8, 8);
- tx := mX+(mWidth-Length(mTitle)*8) div 2;
+ tx := (mX+3*8)+((mWidth-3*8)-Length(mTitle)*8) div 2;
fillRect(tx-3, mY, Length(mTitle)*8+3+2, 8, 0, 0, 128);
drawText8(tx, mY, mTitle, r, g, b);
end;