Skip to content

Instantly share code, notes, and snippets.

@m4xc4v413r4
Created February 17, 2018 01:01
Show Gist options
  • Select an option

  • Save m4xc4v413r4/f17fd3627a2fc34563b071ebcb7ef174 to your computer and use it in GitHub Desktop.

Select an option

Save m4xc4v413r4/f17fd3627a2fc34563b071ebcb7ef174 to your computer and use it in GitHub Desktop.
-------------------------------------------- Starts on line 9919 of v7.3.31 -------------------------------------------------
if not LeaPlusLC.grid then
LeaPlusLC.grid = CreateFrame('FRAME')
LeaPlusLC.grid:Hide()
LeaPlusLC.grid:SetAllPoints(UIParent)
local w, h = GetScreenWidth() * UIParent:GetEffectiveScale(), GetScreenHeight() * UIParent:GetEffectiveScale()
local ratio = w / h
local sqsize = w / 30
local wline = floor(sqsize - (sqsize % 2))
local hline = floor(sqsize / ratio - ((sqsize / ratio) % 2))
-- Plot vertical lines
for i = 0, wline do
local t = LeaPlusLC.grid:CreateTexture(nil, 'BACKGROUND')
if i == wline / 2 then t:SetColorTexture(1, 0, 0, 0.5) else t:SetColorTexture(0, 0, 0, 0.5) end
t:SetPoint('TOPLEFT', LeaPlusLC.grid, 'TOPLEFT', i * w / wline - 1, 0)
t:SetPoint('BOTTOMRIGHT', LeaPlusLC.grid, 'BOTTOMLEFT', i * w / wline + 1, 0)
end
-- Plot horizontal lines
for i = 0, hline do
local t = LeaPlusLC.grid:CreateTexture(nil, 'BACKGROUND')
if i == hline / 2 then t:SetColorTexture(1, 0, 0, 0.5) else t:SetColorTexture(0, 0, 0, 0.5) end
t:SetPoint('TOPLEFT', LeaPlusLC.grid, 'TOPLEFT', 0, -i * h / hline + 1)
t:SetPoint('BOTTOMRIGHT', LeaPlusLC.grid, 'TOPRIGHT', 0, -i * h / hline - 1)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment