diff --git a/code/Mesh/Editor/MeshAssetEditor.cpp b/code/Mesh/Editor/MeshAssetEditor.cpp index 81494c0f0..9efa694ec 100644 --- a/code/Mesh/Editor/MeshAssetEditor.cpp +++ b/code/Mesh/Editor/MeshAssetEditor.cpp @@ -152,7 +152,7 @@ bool MeshAssetEditor::create(ui::Widget* parent, db::Instance* instance, ISerial staticDummy->create(containerFile, L""); Ref< ui::Container > containerOptions = new ui::Container(); - containerOptions->create(containerFile, ui::WsNone, new ui::TableLayout(L"50%,50%,*", L"*", 0_ut, 0_ut)); + containerOptions->create(containerFile, ui::WsNone, new ui::TableLayout(L"50%,50%,*", L"*", 0_ut, 4_ut)); Ref< ui::Container > containerLeft = new ui::Container(); containerLeft->create(containerOptions, ui::WsNone, new ui::TableLayout(L"*", L"*", 0_ut, 4_ut)); diff --git a/code/Render/Editor/Shader/Facades/TextureNodeFacade.cpp b/code/Render/Editor/Shader/Facades/TextureNodeFacade.cpp index b7c9ffda7..57cf7ef78 100644 --- a/code/Render/Editor/Shader/Facades/TextureNodeFacade.cpp +++ b/code/Render/Editor/Shader/Facades/TextureNodeFacade.cpp @@ -25,10 +25,8 @@ #include "Ui/Graph/GraphControl.h" #include "Ui/Graph/Node.h" -namespace traktor +namespace traktor::render { - namespace render - { T_IMPLEMENT_RTTI_CLASS(L"traktor.render.TextureNodeFacade", TextureNodeFacade, INodeFacade) @@ -86,7 +84,7 @@ Ref< ui::Node > TextureNodeFacade::createEditorNode( editorNode->setComment(shaderNode->getComment()); - updateThumb(editor, editorNode, texture); + updateThumb(editor, graphControl, editorNode, texture); return editorNode; } @@ -114,7 +112,7 @@ void TextureNodeFacade::refreshEditorNode( { editorNode->setComment(shaderNode->getComment()); editorNode->setInfo(shaderNode->getInformation()); - updateThumb(editor, editorNode, checked_type_cast< Texture*, false >(shaderNode)); + updateThumb(editor, graphControl, editorNode, checked_type_cast< Texture*, false >(shaderNode)); } void TextureNodeFacade::setValidationIndicator( @@ -125,7 +123,7 @@ void TextureNodeFacade::setValidationIndicator( editorNode->setState(validationSucceeded ? 0 : 1); } -void TextureNodeFacade::updateThumb(editor::IEditor* editor, ui::Node* editorNode, Texture* texture) const +void TextureNodeFacade::updateThumb(editor::IEditor* editor, ui::GraphControl* graphControl, ui::Node* editorNode, Texture* texture) const { Guid textureGuid = texture ? texture->getExternal() : Guid(); if (textureGuid.isValid() && !textureGuid.isNull()) @@ -143,8 +141,8 @@ void TextureNodeFacade::updateThumb(editor::IEditor* editor, ui::Node* editorNod const bool linearGamma = textureAsset->m_output.m_assumeLinearGamma; Ref< drawing::Image > thumbnail = thumbnailGenerator->get( fileName, - 64, - 64, + graphControl->pixel(64_ut), + graphControl->pixel(64_ut), visibleAlpha ? editor::IThumbnailGenerator::Alpha::WithAlpha : editor::IThumbnailGenerator::Alpha::NoAlpha, linearGamma ? editor::IThumbnailGenerator::Gamma::Linear : editor::IThumbnailGenerator::Gamma::SRGB ); @@ -162,8 +160,7 @@ void TextureNodeFacade::updateThumb(editor::IEditor* editor, ui::Node* editorNod } // Failed to update thumb; or no texture bound yet. - editorNode->setImage(0); + editorNode->setImage(nullptr); } - } } diff --git a/code/Render/Editor/Shader/Facades/TextureNodeFacade.h b/code/Render/Editor/Shader/Facades/TextureNodeFacade.h index eb86d5a41..eccd9bd4e 100644 --- a/code/Render/Editor/Shader/Facades/TextureNodeFacade.h +++ b/code/Render/Editor/Shader/Facades/TextureNodeFacade.h @@ -1,6 +1,6 @@ /* * TRAKTOR - * Copyright (c) 2022 Anders Pistol. + * Copyright (c) 2022-2024 Anders Pistol. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -10,17 +10,15 @@ #include "Render/Editor/Shader/INodeFacade.h" -namespace traktor +namespace traktor::ui { - namespace ui - { class INodeShape; - } +} - namespace render - { +namespace traktor::render +{ class Texture; @@ -67,9 +65,7 @@ class TextureNodeFacade : public INodeFacade private: Ref m_nodeShape; - void updateThumb(editor::IEditor* editor, ui::Node* editorNode, Texture* texture) const; + void updateThumb(editor::IEditor* editor, ui::GraphControl* graphControl, ui::Node* editorNode, Texture* texture) const; }; - } } -