Originally Posted by Lybrial
Lua Code:
function LybrialAnchors:CreateVerticalLines(steps, widthStep) for i = 0, steps do local region = self.grid:CreateTexture(); region:SetColorTexture(0, 0, 0); region:SetDrawLayer("BACKGROUND", 0); region:ClearAllPoints(); region:SetPoint("TOPLEFT", self.grid, "TOPLEFT", (i * widthStep), 0); region:SetPoint("BOTTOMRIGHT", self.grid, "BOTTOMLEFT", (i * widthStep), 0); end end
|
You are creating new vertical lines each time that code is called. Currently they are all stacked on top of each other so you can't tell but if you change
steps or
widthStep you will be able to tell.
You need to reuse lines or create new ones as needed and hide the ones that are not in use if you end up with extras. You can see an example of this in
GraphPaper (note: versions 1.4.10 and prior use CreateTexture as you are using here and version 1.4.11 uses the newer CreateLine).