10-13-2022, 03:16 AM
(10-12-2022, 04:46 PM)programmer_ceds Wrote: @teapot You are correct - it is a problem with the script. Yesterday I thought I saw an offset of 40,40 both when the arrow was being drawn directly on the drawable and when it was being drawn on a new layer. Rechecking today I'm seeing an offset of 0,0 when the arrow is being drawn on to a new layer.
Thanks for the clarification.
(10-12-2022, 04:46 PM)programmer_ceds Wrote: The easiest course of action is still to always draw the arrow on a new layer and then to merge this down to the original layer if the user deselects the option to draw the arrow on a new layer (this avoids having to apply the offset to a number of points.
I see what you mean, use of theStrokePoints is scattered throughout. However it's only populated once by a call to gimp-vectors-stroke-get-points, so straight after that you could modify it by deducting the offsets from all it's points. Then the rest of the code won't need to change.
(10-12-2022, 09:11 PM)BugsBunnySan Wrote: Hm, I tried the script just now and now the arrowhead appears in the correct location, but in return, the layer that it is drawn onto is resized to the full image size. Probably because the new intermediate layer for the arrow is the full image size by default on creating it and merging it down onto the layer the arrow should be in makes that layer full sized also... Maybe if the intermediate layer that the arrow is drawn on and then merged down where the same size and location in the image as the layer the arrow should be in?
Also if the original layer isn't visible when the script is run the new arrow layer will be merged down to the first visible layer below it or there will be an error if there isn't a visible layer to merge down to.