mirror of
https://github.com/hyprwm/hyprcursor.git
synced 2024-11-17 02:35:57 +01:00
parent
6a92473237
commit
7bd0d55aa2
1 changed files with 10 additions and 7 deletions
|
@ -491,12 +491,15 @@ static Hyprlang::CParseResult parseDefineSize(const char* C, const char* V) {
|
||||||
|
|
||||||
image.filename = RHS;
|
image.filename = RHS;
|
||||||
|
|
||||||
try {
|
if (!image.filename.ends_with(".svg")) {
|
||||||
image.size = std::stoull(LHS);
|
try {
|
||||||
} catch (std::exception& e) {
|
image.size = std::stoull(LHS);
|
||||||
result.setError(e.what());
|
} catch (std::exception& e) {
|
||||||
return result;
|
result.setError(e.what());
|
||||||
}
|
return result;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
image.size = 0;
|
||||||
|
|
||||||
currentTheme->shapes.back()->images.push_back(image);
|
currentTheme->shapes.back()->images.push_back(image);
|
||||||
|
|
||||||
|
@ -633,7 +636,7 @@ std::optional<std::string> CHyprcursorImplementation::loadTheme() {
|
||||||
// load image
|
// load image
|
||||||
Debug::log(TRACE, "Loading {} for shape {}", i.filename, cursor.path().stem().string());
|
Debug::log(TRACE, "Loading {} for shape {}", i.filename, cursor.path().stem().string());
|
||||||
auto* IMAGE = LOADEDSHAPE.images.emplace_back(std::make_unique<SLoadedCursorImage>()).get();
|
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->delay = i.delay;
|
||||||
IMAGE->isSVG = SHAPE->shapeType == SHAPE_SVG;
|
IMAGE->isSVG = SHAPE->shapeType == SHAPE_SVG;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue