Skip to content
This repository was archived by the owner on Jun 14, 2023. It is now read-only.

Commit 56dc3bc

Browse files
author
Jayden Smith
committed
Fixed mode parameter not being respected.
1 parent 438e0ff commit 56dc3bc

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## 1.0.3 - 2020-10-14
8+
### Fixed
9+
- Fixed mode parameter not being respected
10+
711
## 1.0.2 - 2020-10-14
812
### Fixed
913
- Fixed empty arguments bug

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "tasdev-au/craft-graphql-srcset",
33
"description": "Adds the @srcset GraphQL directive for generating a comma-separated list of image transforms.",
44
"type": "craft-plugin",
5-
"version": "1.0.2",
5+
"version": "1.0.3",
66
"keywords": [
77
"craft",
88
"cms",

src/gql/directives/SrcSet.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public static function apply($source, $value, array $arguments, ResolveInfo $res
102102
$transforms[] = [
103103
'width' => $width,
104104
'height' => isset($arguments['ratio']) ? round($width * floatval($arguments['ratio'])) : null,
105+
'mode' => isset($arguments['mode']) ? $arguments['mode'] : null,
105106
'format' => isset($arguments['format']) ? $arguments['format'] : null,
106107
];
107108
}
@@ -113,6 +114,7 @@ public static function apply($source, $value, array $arguments, ResolveInfo $res
113114
$transforms[] = [
114115
'width' => $imageWidth,
115116
'height' => isset($arguments['ratio']) ? round($imageWidth * floatval($arguments['ratio'])) : null,
117+
'mode' => isset($arguments['mode']) ? $arguments['mode'] : null,
116118
'format' => isset($arguments['format']) ? $arguments['format'] : null,
117119
];
118120
}

0 commit comments

Comments
 (0)