diff --git a/src/ImageIO.cpp b/src/ImageIO.cpp index c5106debb..006dd55a5 100644 --- a/src/ImageIO.cpp +++ b/src/ImageIO.cpp @@ -69,7 +69,7 @@ std::vector ImageIO::loadFromMemoryRGBA32(const unsigned char * d } else { - LOG(LogError) << "Error - File type unknown/unsupported!"; + LOG(LogError) << "Error - File type " << (format == FIF_UNKNOWN ? "unknown" : "unsupported") << "!"; } //free FIMEMORY again FreeImage_CloseMemory(fiMemory); diff --git a/src/components/RatingComponent.cpp b/src/components/RatingComponent.cpp index dacfd7329..61754c610 100644 --- a/src/components/RatingComponent.cpp +++ b/src/components/RatingComponent.cpp @@ -2,11 +2,12 @@ #include "../Renderer.h" #include "../Window.h" #include "../Util.h" +#include "../resources/SVGResource.h" RatingComponent::RatingComponent(Window* window) : GuiComponent(window) { - mFilledTexture = TextureResource::get(":/star_filled.png", true); - mUnfilledTexture = TextureResource::get(":/star_unfilled.png", true); + mFilledTexture = TextureResource::get(":/star_filled.svg", true); + mUnfilledTexture = TextureResource::get(":/star_unfilled.svg", true); mValue = 0.5f; mSize << 64 * 5.0f, 64; updateVertices(); @@ -40,6 +41,15 @@ void RatingComponent::onSizeChanged() else if(mSize.x() == 0) mSize[0] = mSize.y() * 5.0f; + auto filledSVG = dynamic_cast(mFilledTexture.get()); + auto unfilledSVG = dynamic_cast(mUnfilledTexture.get()); + + size_t sz = (size_t)round(mSize.y()); + if(filledSVG) + filledSVG->rasterizeAt(sz, sz); + if(unfilledSVG) + unfilledSVG->rasterizeAt(sz, sz); + updateVertices(); } diff --git a/src/components/TextComponent.cpp b/src/components/TextComponent.cpp index 08586f7e1..21cab7b26 100644 --- a/src/components/TextComponent.cpp +++ b/src/components/TextComponent.cpp @@ -68,8 +68,8 @@ void TextComponent::render(const Eigen::Affine3f& parentTrans) Eigen::Vector3f dim(mSize.x(), mSize.y(), 0); dim = trans * dim - trans.translation(); - //Renderer::pushClipRect(Eigen::Vector2i((int)trans.translation().x(), (int)trans.translation().y()), - // Eigen::Vector2i((int)(dim.x() + 0.5f), (int)(dim.y() + 0.5f))); + Renderer::pushClipRect(Eigen::Vector2i((int)trans.translation().x(), (int)trans.translation().y()), + Eigen::Vector2i((int)(dim.x() + 0.5f), (int)(dim.y() + 0.5f))); if(mTextCache) { @@ -97,7 +97,7 @@ void TextComponent::render(const Eigen::Affine3f& parentTrans) mFont->renderTextCache(mTextCache.get()); } - //Renderer::popClipRect(); + Renderer::popClipRect(); } void TextComponent::calculateExtent() diff --git a/src/guis/GuiMetaDataEd.cpp b/src/guis/GuiMetaDataEd.cpp index 9afc6d4cf..04c9144bf 100644 --- a/src/guis/GuiMetaDataEd.cpp +++ b/src/guis/GuiMetaDataEd.cpp @@ -41,7 +41,7 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, MetaDataList* md, const std::vector { ed = std::make_shared(window); ed->setSize(0, lbl->getSize().y()); - row.addElement(ed, false, false); + row.addElement(ed, false, true); mMenu.addRow(row); break; } diff --git a/src/resources/TextureResource.cpp b/src/resources/TextureResource.cpp index b49c33cc2..bd88248c0 100644 --- a/src/resources/TextureResource.cpp +++ b/src/resources/TextureResource.cpp @@ -62,7 +62,7 @@ void TextureResource::initFromMemory(const char* data, size_t length) if(imageRGBA.size() == 0) { - LOG(LogError) << "Could not initialize texture from memory (invalid data)!"; + LOG(LogError) << "Could not initialize texture from memory, invalid data! (" << mPath << ")"; return; }