To be able to flip/mirror a shape align to left to right. In other words mirror a shape clone to left or right
It means it would be possible to draw a shape and mirror the copy and merge together.
The way flip horizontally or vertically works in current version of Pixelmator Pro is not so useful because the position is always wrong.
The problem with my script will be when flip horizontally make width to (negative number). Because now its not possible to
use width or height to position a shape on the screen because the value will be wrong.
The great thing with clone... its possible to edit 1 layer shape to effect the children (clones)
That feature is not possible in Pixelmator Pro.
property alignRightEdge : true
property alignLeftEdge : false
tell application "Pixelmator Pro"
tell front document to tell current layer
set theName to its name
set {theWidth, theHeight} to {width, height}
set {xPos, yPos} to position
end tell
(**
* Align to left edge of flip horizontally with duplicate.
*)
if (alignLeftEdge is true) then
set alignLeftEdge to {xPos - theWidth, yPos}
tell front document to duplicate layer theName
tell front document to tell current layer
flip horizontally
set position to alignLeftEdge
end tell
end if
(**
* Align to right edge of flip horizontally with duplicate.
*)
if (alignRightEdge is true) then
set alignRightEdge to {xPos + theWidth, yPos}
tell front document to duplicate layer theName
tell front document to tell current layer
flip horizontally
set position to alignRightEdge
end tell
end if
end tell