Merge branch 'main' into beta

This commit is contained in:
David Capello 2022-06-28 19:05:54 -03:00
commit faecd682fc
7 changed files with 40 additions and 12 deletions

View File

@ -7,11 +7,11 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
build_type: [debug]
build_type: [RelWithDebInfo, Debug]
enable_ui: [off]
include:
- os: ubuntu-latest
build_type: debug
build_type: Debug
enable_ui: on
steps:
- uses: actions/checkout@v2
@ -36,10 +36,17 @@ jobs:
- name: Generating Makefiles
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]] ; then
export enable_ccache=off
else
export enable_ccache=on
fi
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
-DENABLE_TESTS=ON \
-DENABLE_UI=${{ matrix.enable_ui }}
-DENABLE_UI=${{ matrix.enable_ui }} \
-DENABLE_CCACHE=$enable_ccache
- name: Compiling
shell: bash
run: |

2
laf

@ -1 +1 @@
Subproject commit 395a74c990f4df3889df0b7e140998ba68ea49af
Subproject commit a361cb538e8ea7bfa74ad9ce488d3318a3db3bc2

View File

@ -23,6 +23,7 @@
#include "app/file/gif_format.h"
#include "app/file/png_format.h"
#include "app/file_selector.h"
#include "app/filename_formatter.h"
#include "app/i18n/strings.h"
#include "app/job.h"
#include "app/modules/gui.h"
@ -390,7 +391,11 @@ void SaveFileCopyAsCommand::onExecute(Context* context)
if (!result)
return;
outputFilename = win.outputFilenameValue();
FilenameInfo fnInfo;
fnInfo
.filename(context->activeDocument()->name())
.layerName(win.layersValue());
outputFilename = filename_formatter(win.outputFilenameValue(), fnInfo);
if (askOverwrite &&
base::is_file(outputFilename)) {

View File

@ -689,6 +689,11 @@ Doc* DocExporter::exportSheet(Context* ctx, base::task_token& token)
// Save the image files.
if (!m_textureFilename.empty()) {
DX_TRACE("DocExporter::exportSheet", m_textureFilename);
// filename_formatter usage to include {title} key word on CLI.
FilenameInfo fnInfo;
fnInfo.filename(ctx->activeDocument()->name());
m_textureFilename = filename_formatter(m_textureFilename.c_str(), fnInfo);
textureDocument->setFilename(m_textureFilename.c_str());
int ret = save_document(ctx, textureDocument.get());
if (ret == 0)
@ -1150,7 +1155,7 @@ void DocExporter::renderTexture(Context* ctx,
Image* textureImage,
base::task_token& token) const
{
textureImage->clear(0);
textureImage->clear(textureImage->maskColor());
int i = 0;
for (const auto& sample : samples) {

View File

@ -4449,7 +4449,10 @@ void Timeline::setLayerCollapsedFlag(const layer_t l, const bool state)
int Timeline::separatorX() const
{
return std::clamp(m_separator_x, headerBoxWidth(), bounds().w-guiscale());
return std::clamp(m_separator_x,
headerBoxWidth(),
std::max(bounds().w-guiscale(),
headerBoxWidth()));
}
void Timeline::setSeparatorX(int newValue)

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (c) 2019-2020 Igara Studio S.A.
// Copyright (c) 2019-2022 Igara Studio S.A.
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -27,8 +27,8 @@ void move_or_copy_palette_colors(
if (beforeIndex >= palette.size()) {
palette.resize(beforeIndex); // TODO is need to resize the
// palette? why not "const Palette& palette"
picks.resize(palette.size());
}
picks.resize(palette.size());
palette.copyColorsTo(&newPalette);

View File

@ -1,5 +1,5 @@
// Aseprite Document Library
// Copyright (c) 2019-2021 Igara Studio S.A.
// Copyright (c) 2019-2022 Igara Studio S.A.
// Copyright (c) 2001-2017 David Capello
//
// This file is released under the terms of the MIT license.
@ -9,6 +9,7 @@
#define DOC_PALETTE_PICKS_H_INCLUDED
#pragma once
#include "base/debug.h"
#include "doc/color.h"
#include <algorithm>
@ -36,8 +37,15 @@ namespace doc {
const_iterator begin() const { return m_items.begin(); }
const_iterator end() const { return m_items.end(); }
const_reference operator[](int idx) const { return m_items[idx]; }
reference operator[](int idx) { return m_items[idx]; }
const_reference operator[](int idx) const {
ASSERT(idx >= 0 && idx < int(m_items.size()));
return m_items[idx];
}
reference operator[](int idx) {
ASSERT(idx >= 0 && idx < int(m_items.size()));
return m_items[idx];
}
void resize(int n) {
m_items.resize(n, false);