Created
February 17, 2018 01:01
-
-
Save m4xc4v413r4/f17fd3627a2fc34563b071ebcb7ef174 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -------------------------------------------- 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