DModelPanel on F4 Menu using SetScissor

Image of Problem:

Code:


Panel = vgui.Create("DPanelList")
		Panel:SetSize(390, 540)
		Panel:EnableHorizontal( true )
		Panel:EnableVerticalScrollbar( true )
		Panel:SetSkin(GAMEMODE.Config.DarkRPSkin)
		Panel.Paint() = function()
			render.SetScissorRect( 0, 0, Panel:GetWide(), 0, true )
		end

Any help would be nice, thanks.

Taken from Pointshop:
[lua] local oldPaint = DModelPanel.Paint
ModelPanel.Paint = function( self )
local x, y = self:LocalToScreen( 0, 0 )
local w, h = self:GetSize()

					local sl, st, sr, sb = x, y, x + w, y + h
					 
					local p = self
					while p:GetParent() do
						p = p:GetParent()
						local pl, pt = p:LocalToScreen( 0, 0 )
						local pr, pb = pl + p:GetWide(), pt + p:GetTall()
						sl = sl < pl and pl or sl
						st = st < pt and pt or st
						sr = sr > pr and pr or sr
						sb = sb > pb and pb or sb
					end
					 
					render.SetScissorRect( sl, st, sr, sb, true )
					oldPaint(self)
					render.SetScissorRect( 0, 0, 0, 0, false )
				end[/lua]

Tried that code, but still didn’t seem to cut. :\

Still in a need of a fix, thanks. :slight_smile:

You may have done it wrong, can we see your code?