lib: set size to 0 for svg images

ref #13
This commit is contained in:
Vaxry 2024-03-23 01:04:46 +00:00
parent 6a92473237
commit 7bd0d55aa2

View file

@ -491,12 +491,15 @@ static Hyprlang::CParseResult parseDefineSize(const char* C, const char* V) {
image.filename = RHS;
if (!image.filename.ends_with(".svg")) {
try {
image.size = std::stoull(LHS);
} catch (std::exception& e) {
result.setError(e.what());
return result;
}
} else
image.size = 0;
currentTheme->shapes.back()->images.push_back(image);
@ -633,7 +636,7 @@ std::optional<std::string> CHyprcursorImplementation::loadTheme() {
// load image
Debug::log(TRACE, "Loading {} for shape {}", i.filename, cursor.path().stem().string());
auto* IMAGE = LOADEDSHAPE.images.emplace_back(std::make_unique<SLoadedCursorImage>()).get();
IMAGE->side = i.size;
IMAGE->side = SHAPE->shapeType == SHAPE_SVG ? 0 : i.size;
IMAGE->delay = i.delay;
IMAGE->isSVG = SHAPE->shapeType == SHAPE_SVG;