View Single Post
02-06-15, 05:50 PM   #11
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by Duugu View Post
As far as I know that's impossible.

The rotate animation ignores clickable areas. To be honest ... I do believe the animation ignores the parent frame itself at all and the rotation is applied to ALL of its elements (like backdrops) and childs (like textures) only.

Whatever the reason is - I couldn't find a way to rotate a clickable area.
As I wrote ... the feature is more or less broken.

[e]
I was working on a workaround for this a while ago but never finished it.
The idea was to make the frame non-clickable and to (internaly) fill the rotated frame with the required number of non-rotated invisible clickable frames each having a clickable area and to map the events to the main frame.

See this post: http://www.wowinterface.com/forums/s...light=triangle
It's possible to create a polynom and find if a point inside the polynom or not via an update script, but it's not worth the hassle to use it, and goes strong on the resources with fps like update speed:

Lua Code:
  1. local x, y = -0.5, 0.5
  2.  
  3. local p = {
  4.     [1] = {x = 0, y = 0},
  5.     [2] = {x = -1, y = 0},
  6.     [3] = {x = -1, y = 1},
  7.     [4] = {x = 0, y = 1}
  8. }
  9.  
  10. function PointInPolynom(p, x, y)
  11.     local c = false
  12.     for i = 1, #p do
  13.         local j = i + 1
  14.         if j > #p then
  15.             j = 1
  16.         end
  17.         if ((p[i].y > y) ~= (p[j].y > y)) and (x < (p[j].x - p[i].x) * (y - p[i].y) / (p[j].y - p[i].y) + p[i].x) then
  18.             c = not c
  19.         end
  20.     end
  21.     return c
  22. end
  Reply With Quote