Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions joy.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,34 @@ def __init__(self, sx, sy=None):
def as_str(self):
return f"scale({self.sx} {self.sy})"


class Skew(Transformation):
"""Creates a new scale transformation.

Parameters:
x:
The Skew factor in the x direction.

y:
The Skew factor in the y direction. Defaults to
the value of x if not provided.
"""
def __init__(self , x=0 , y=0):
if y is None:
y = x
self.x = x
self.y = y

def as_str(self):
str = ""
if self.y is None:
str = f"skewX({self.x})"
else:
str = f"skewX({self.x}) skewY({self.y})"




class Repeat(Transformation):
"""Repeat is a higher-order transformation that repeats a
transformation multiple times.
Expand Down Expand Up @@ -1010,3 +1038,5 @@ def random(a=None, b=None):
else:
delta = b - a
return a + delta * random_module.random()