Permalink
Browse files

Fixed DModelPanel:PreDrawModel scissor rect

Fixed DModelPanel:PreDrawModel not restoring the scissor rect
  • Loading branch information...
1 parent e1394d6 commit 9092b5e3d63202392134105be004750b826d4e0e @robotboy655 robotboy655 committed Jan 19, 2016
Showing with 4 additions and 6 deletions.
  1. +4 −6 garrysmod/lua/vgui/dmodelpanel.lua
@@ -108,14 +108,12 @@ function PANEL:DrawModel()
end
render.SetScissorRect( leftx, topy, rightx, bottomy, true )
- if self:PreDrawModel( self.Entity ) == false then
- return
+ local ret = self:PreDrawModel( self.Entity )
+ if ( ret && ret != false ) then
+ self.Entity:DrawModel()
+ self:PostDrawModel( self.Entity )
end
- self.Entity:DrawModel()
-
- self:PostDrawModel( self.Entity )
-
render.SetScissorRect( 0, 0, 0, 0, false )
end

0 comments on commit 9092b5e

Please sign in to comment.