Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,4 @@ Network Trash Folder
Temporary Items
.apdisk
uv.lock
tmp/
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ classifiers = [
requires-python = ">=3.9"

[dependency-groups]
dev = ["pytest", "pytest-cov", "ipython", "ruff", "types-docopt"]
dev = [
"pytest",
"pytest-cov",
"ipykernel",
"ruff",
"types-docopt",
]
docs = ["sphinx", "sphinx_rtd_theme"]

[project.scripts]
Expand Down
9 changes: 5 additions & 4 deletions src/psd_tools/composite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,17 +383,18 @@ def _get_object(self, layer: Layer) -> tuple[np.ndarray, np.ndarray, np.ndarray]

alpha = shape * 1.0 # Constant factor is always 1.

# Composite clip layers.
if layer.has_clip_layers():
color = self._apply_clip_layers(layer, color, alpha)

# TODO: Prepare a test case for clipping mask with stroke to check the order.
# Apply stroke if any.
if layer.has_vector_mask() and layer.stroke is not None and layer.stroke.enabled:
color_s, shape_s, alpha_s = self._get_stroke(layer)
compositor = Compositor(self._viewport, color, alpha)
compositor._apply_source(color_s, shape_s, alpha_s, layer.stroke.blend_mode)
color, _, _ = compositor.finish()

# Composite clip layers.
if layer.has_clip_layers():
color = self._apply_clip_layers(layer, color, alpha)

assert color is not None
assert shape is not None
assert alpha is not None
Expand Down