View Single Post
08-27-17, 06:37 AM   #1
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
[7.2.5+] frame:SetClipsChildren(true) causes flickering in certain scenarios

Title says it all.

This snippet will allow you to reproduce this bug:
Lua Code:
  1. local frame = CreateFrame("Frame")
  2. frame:RegisterEvent("NAME_PLATE_UNIT_ADDED")
  3.  
  4. frame:SetScript("OnEvent", function(_, event, unit)
  5.     if event == "NAME_PLATE_UNIT_ADDED" and unit then
  6.         local nameplate = C_NamePlate.GetNamePlateForUnit(unit)
  7.         if not nameplate then return end
  8.  
  9.         if not nameplate.test then
  10.             local test = CreateFrame("Frame", "Test"..nameplate:GetName(), nameplate)
  11.             test:SetPoint("CENTER", nameplate, "CENTER", 0, 0)
  12.             test:SetSize(64, 64)
  13.             test:SetScale(UIParent:GetEffectiveScale())
  14.             nameplate.test = test
  15.  
  16.             local child = CreateFrame("Frame", nil, test)
  17.             child:SetSize(128, 12)
  18.             child:SetPoint("TOP", test, "TOP", 0, 0)
  19.             child:SetClipsChildren(true)
  20.  
  21.             local texture = child:CreateTexture("")
  22.             texture:SetAllPoints()
  23.             texture:SetColorTexture(0, 1, 1)
  24.         end
  25.     end
  26. end)

Result looks like this:


If I set it to false, no flickering occurs.


If I parent test frame to, let's say, UIParent other frames start flickering, for instance, CharacterFrame or Minimap.

Obv, this bug is present on PTR too.
__________________

Last edited by lightspark : 08-27-17 at 07:20 AM. Reason: fixed code...
  Reply With Quote