Graphics.fillPath()
-
Cant seem to get this to work at all, I've defined my path in my paths object like this (pretty std way);
const var triangleDown = "46.t0F..d.QLP3MCIFKBwAQN96gCoI5vPzevO6P..XQD0eOfODa..3AD0eOfOzXkA"; icons.triangleDown = Content.createPath(); icons.triangleDown.loadFromData(triangleDown);
and I just say this:
g.fillPath(Paths.icons.triangleDown, [100,100,100,100]);
but it doesnt draw anything...what am I doing wrong?
I should say this is in a panel paint routine not a LAF callback.
-
@Lindon said in Graphics.fillPath():
[100,100,100,100]
wouldn't this draw the pixel in the last pixel of the bottom right of your panel?
I think you need [0,0,100,100] -
@Dan-Korneff said in Graphics.fillPath():
@Lindon said in Graphics.fillPath():
[100,100,100,100]
wouldn't this draw the pixel in the last pixel of the bottom right of your panel?
I think you need [0,0,100,100]Well my panel is 1000 x 600, so it should draw the graphics 100 pixels in and down and be 100 pixels square...[x,y,w,h]
-
@Lindon
Changing some code here will make it workconst triangleDown = "46.t0F..d.QLP3MCIFKBwAQN96gCoI5vPzevO6P..XQD0eOfODa..3AD0eOfOzXkA"; const path = Content.createPath(); path.loadFromData(triangleDown); g.fillPath(path, [100,100,100,100]);
-
@ulrik yeah I'm already doing that in my paths.js
icons.triangleDown = Content.createPath(); icons.triangleDown.loadFromData(triangleDown);
-
@Lindon then there must be some issue with your paths?
-
@ulrik -- yet weirdly your works and mine doesnt... odd....thanks I can take it from here I think...
-
@Lindon
this worksconst Paths = {"icons":{}}; const var triangleDown = "46.t0F..d.QLP3MCIFKBwAQN96gCoI5vPzevO6P..XQD0eOfODa..3AD0eOfOzXkA"; Paths.icons.triangleDown = Content.createPath(); Paths.icons.triangleDown.loadFromData(triangleDown); g.fillPath(Paths.icons.triangleDown, [100,100,100,100]);
-
@Lindon namespace issue?
-
@Dan-Korneff said in Graphics.fillPath():
@Lindon namespace issue?
possibly - tho I checked the namespace stuff, but I recompiled everything and its working OK now... very likely user error.