From d042ad67ed4db72bf0265804e26610e565f15cf2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 2 Nov 2022 19:46:13 +0200 Subject: SL-18448 Make material editor's scroll smarter --- indra/newview/llmaterialeditor.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmaterialeditor.cpp') diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 792a916e6b..cf627cf992 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -443,6 +443,20 @@ void LLMaterialEditor::onClose(bool app_quitting) LLPreview::onClose(app_quitting); } +void LLMaterialEditor::handleReshape(const LLRect& new_rect, bool by_user) +{ + if (by_user) + { + const LLRect old_rect = getRect(); + LLRect clamp_rect(new_rect); + clamp_rect.mRight = clamp_rect.mLeft + old_rect.getWidth(); + LLPreview::handleReshape(clamp_rect, by_user); + } + else + { + LLPreview::handleReshape(new_rect, by_user); + } +} LLUUID LLMaterialEditor::getBaseColorId() { @@ -648,7 +662,7 @@ void LLMaterialEditor::resetUnsavedChanges() void LLMaterialEditor::markChangesUnsaved(U32 dirty_flag) { mUnsavedChanges |= dirty_flag; - if (!mIsOverride) + if (mIsOverride) { // at the moment live editing (mIsOverride) applies everything 'live' // and "unsaved_changes", save/cancel buttons don't exist there -- cgit v1.2.3