
Skalowanie – Lustro w poziomie
Użyty został Skrypt transform.js.
Odbicie lustrzane figury tworzymy gdy dx <0.
Figura jest odbijana symetrycznie po drugiej stronie osi Y, musimy więc dokonać translacji figury w pole widzenia.
Listing
var cv = document.getElementById("canvas");
var ctx = cv.getContext("2d");
var leftX = 10;
var topY = 10;
var width = 150;
var height = 100;
var cornerRadius = 15;
drawRectangle(ctx);
ctx.scale(-1,1);
ctx.translate(-340, 60);
drawRectangle(ctx);
