Permalink
Browse files

Fixed background zoom on some screen resolutions

  • Loading branch information...
1 parent 19f8aea commit 2e4de5348c48900f8317c62289c96e7d710d50d7 @robotboy655 robotboy655 committed Sep 22, 2014
Showing with 4 additions and 6 deletions.
  1. +4 −6 garrysmod/lua/menu/background.lua
@@ -30,8 +30,8 @@ local function Render( tbl )
surface.SetMaterial( tbl.mat )
surface.SetDrawColor( 255, 255, 255, tbl.Alpha )
- local w = ScrH() * tbl.Size * tbl.Ratio
- local h = ScrH() * tbl.Size
+ local w = ScrH() * tbl.Size * tbl.Ratio
+ local h = ScrH() * tbl.Size
local x = ScrW() * 0.5
local y = ScrH() * 0.5
@@ -66,8 +66,6 @@ function DrawBackground()
surface.SetDrawColor( 255, 255, 255, 255 )
surface.DrawTexturedRect( 0, 0, 1024, ScrH() )
-
-
end
function ClearBackgroundImages( img )
@@ -113,8 +111,8 @@ function ChangeBackground( currentgm )
if ( Active.Ratio < ScrW() / ScrH() ) then
- Active.Size = Active.Size * ( ScrW() / ScrH() );
+ Active.Size = Active.Size + ( ( ScrW() / ScrH() ) - Active.Ratio )
end
-end
+end

0 comments on commit 2e4de53

Please sign in to comment.