Squashed 'deps/nostalgia/' changes from a75c4a11..e758e03d

e758e03d [nostalgia,olympic] Update for ox::Error changes
835e3270 [ox] Make Error use std::source_location
480dd5ec [ox/std] Cleanup
dba6bb58 [ox/std] Make Vector(initializer_list) use list size as capacity
40a456e5 [ox/std] Add Vector::shrink_to_fit
bf5be00c Merge commit 'dc96270ca5e882e41f6b657be14a20e8bd2ad501'
dc7c2559 [studio] Make selection tracker not go below 0

git-subtree-dir: deps/nostalgia
git-subtree-split: e758e03d2bbffbf72d28970ec379e29d7dd0cbf3
This commit is contained in:
2025-01-02 22:03:05 -06:00
parent dc96270ca5
commit 25133af822
14 changed files with 81 additions and 54 deletions

View File

@@ -126,12 +126,12 @@ class SelectionTracker {
constexpr Selection selection() const noexcept {
return {
{
ox::min(m_pointA.x, m_pointB.x),
ox::min(m_pointA.y, m_pointB.y),
ox::max(0, ox::min(m_pointA.x, m_pointB.x)),
ox::max(0, ox::min(m_pointA.y, m_pointB.y)),
},
{
ox::max(m_pointA.x, m_pointB.x),
ox::max(m_pointA.y, m_pointB.y),
ox::max(0, ox::max(m_pointA.x, m_pointB.x)),
ox::max(0, ox::max(m_pointA.y, m_pointB.y)),
},
};
}

View File

@@ -13,7 +13,7 @@ namespace studio {
class NoChangesException: public ox::Exception {
public:
inline NoChangesException(std::source_location sloc = std::source_location::current()):
ox::Exception(sloc.file_name(), sloc.line(), 1, "Command makes no changes.") {}
ox::Exception(1, "Command makes no changes.", sloc) {}
};
class UndoCommand {

View File

@@ -46,7 +46,7 @@ void BaseEditor::save() noexcept {
setUnsavedChanges(false);
} else {
if constexpr(ox::defines::Debug) {
oxErrorf("Could not save file {}: {} ({}:{})", itemPath(), toStr(err), err.file, err.line);
oxErrorf("Could not save file {}: {} ({}:{})", itemPath(), toStr(err), err.src.file_name(), err.src.line());
} else {
oxErrorf("Could not save file {}: {}", itemPath(), toStr(err));
}