I'm defining a shaded area that is offset from a origin coordinate, so that the whole of the drawing can be moved by only changing that single coordinate:
\coordinate (origin) at (0,0); \shade [left color=blue, right color=red] (origin) ++ (90:0.4) ++ (170:1) --++ (90:0.6) --++ (0:0.2) --++ (-90:0.6) -- cycle;
I found out that the
cycle completes the part of the rectangle that was drawn by the "pen", and not the offset that the pen moved before drawing, which was perfect for this.
But then the shading isn't working, and I guess it's because it's defining the gradient between
origin (x=0) and the left edge of the rectangle, rather than between the left and right parts of the rectangle.
Is there a way of fixing my code so that the rectangle is shaded as one would be that wasn't offset?