mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-10 05:44:16 +00:00
cleanup
This commit is contained in:
parent
4a1db58e6e
commit
5e50faeaa3
1 changed files with 1 additions and 11 deletions
12
src/image.c
12
src/image.c
|
@ -32,17 +32,7 @@ bool image_set_enabled(struct image* image, bool enabled) {
|
|||
bool image_set_link(struct image* image, struct image* link) {
|
||||
if (image->link == link) return false;
|
||||
image->link = link;
|
||||
if (link) {
|
||||
image->enabled = true;
|
||||
CGRect bounds = (CGRect){{0,0},
|
||||
{ CGImageGetWidth(image->link->image_ref) / image->scale,
|
||||
CGImageGetHeight(image->link->image_ref) / image->scale }};
|
||||
|
||||
image->size = bounds.size;
|
||||
image->bounds = (CGRect){{0, 0},
|
||||
{bounds.size.width * image->scale,
|
||||
bounds.size.height * image->scale}};
|
||||
}
|
||||
if (link) image->enabled = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue