-
Notifications
You must be signed in to change notification settings - Fork 7
Add support for themes service data #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 12 commits
8add3fd
c9d132f
0341de3
dbdd4b9
be356d2
d9fcc7a
555ce84
eba2acb
572d7da
549d150
e09176f
d794183
47f764c
a6895c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |||||
| use DiagramGenerator\Board; | ||||||
| use DiagramGenerator\Fen; | ||||||
| use DiagramGenerator\Generator; | ||||||
| use DiagramGenerator\Image\StorageInterface; | ||||||
| use Intervention\Image\Gd\Decoder; | ||||||
| use Intervention\Image\Gd\Font; | ||||||
| use Intervention\Image\Image as BaseImage; | ||||||
|
|
@@ -18,13 +19,17 @@ class Image | |||||
| /** @var BaseImage */ | ||||||
| protected $image; | ||||||
|
|
||||||
| /** @var Storage */ | ||||||
| /** @var StorageInterface */ | ||||||
| protected $storage; | ||||||
|
|
||||||
| /** @var Config */ | ||||||
| protected $config; | ||||||
|
|
||||||
| public function __construct(Storage $storage, Config $config) | ||||||
| /** | ||||||
| * @param StorageInterface $storage | ||||||
|
||||||
| * @param Config $config | ||||||
| */ | ||||||
| public function __construct($storage, Config $config) | ||||||
|
||||||
| public function __construct($storage, Config $config) | |
| public function __construct(StorageInterface $storage, Config $config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if backgroundTexture image doesn't have perfect dimensions, this could result in asymetric image generated, right?
Of course, if background is always perfect, then nothing to worry about.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <?php | ||
|
|
||
| namespace DiagramGenerator\Image; | ||
|
|
||
| use DiagramGenerator\Config; | ||
| use DiagramGenerator\Fen; | ||
| use DiagramGenerator\Fen\Piece; | ||
| use Intervention\Image\Image; | ||
|
|
||
| interface StorageInterface | ||
| { | ||
| /** | ||
| * @return Image | ||
| */ | ||
| public function getPieceImage(Piece $piece, Config $config); | ||
|
|
||
| /** | ||
| * @return Image|null | ||
| */ | ||
| public function getBackgroundTextureImage(Config $config); | ||
|
|
||
| /** | ||
| * @return int | ||
| */ | ||
| public function getMaxPieceHeight(Fen $fen, Config $config); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I usually prefer is to rename old class to
StorageLegacy, because ultimately we would won't to delete the old class and new one should have the default (Storage) name. One less step during FF cleanup.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change it. I used
Newsuffix to make review easier, as it is obvious that original file was not changed.