mirror of https://github.com/aseprite/aseprite.git
Compare commits
3 Commits
4f4582bc9d
...
d85727bb17
| Author | SHA1 | Date |
|---|---|---|
|
|
d85727bb17 | |
|
|
107e846911 | |
|
|
5ddd14106b |
|
|
@ -1,5 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2019-2024 Igara Studio S.A.
|
// Copyright (C) 2019-2025 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
|
@ -108,7 +108,7 @@ void ColorPicker::pickColor(const Site& site,
|
||||||
plan.addLayer(sprite->root(), site.frame());
|
plan.addLayer(sprite->root(), site.frame());
|
||||||
|
|
||||||
doc::CelList cels;
|
doc::CelList cels;
|
||||||
sprite->pickCels(pos, kOpacityThreshold, plan, cels);
|
sprite->pickCels(pos, plan, cels, kOpacityThreshold);
|
||||||
if (!cels.empty())
|
if (!cels.empty())
|
||||||
m_layer = cels.front()->layer();
|
m_layer = cels.front()->layer();
|
||||||
|
|
||||||
|
|
@ -181,7 +181,7 @@ void ColorPicker::pickColor(const Site& site,
|
||||||
plan.addLayer(refLayer, site.frame());
|
plan.addLayer(refLayer, site.frame());
|
||||||
|
|
||||||
doc::CelList cels;
|
doc::CelList cels;
|
||||||
sprite->pickCels(pos, kOpacityThreshold, plan, cels);
|
sprite->pickCels(pos, plan, cels, kOpacityThreshold);
|
||||||
|
|
||||||
for (const Cel* cel : cels) {
|
for (const Cel* cel : cels) {
|
||||||
doc::color_t imageColor;
|
doc::color_t imageColor;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ namespace app { namespace script {
|
||||||
template<>
|
template<>
|
||||||
void push_value_to_lua(lua_State* L, const std::nullptr_t&)
|
void push_value_to_lua(lua_State* L, const std::nullptr_t&)
|
||||||
{
|
{
|
||||||
TRACEARGS("push_value_to_lua nullptr_t");
|
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@
|
||||||
#include "doc/layer.h"
|
#include "doc/layer.h"
|
||||||
#include "doc/layer_tilemap.h"
|
#include "doc/layer_tilemap.h"
|
||||||
#include "doc/mask.h"
|
#include "doc/mask.h"
|
||||||
|
#include "doc/render_plan.h"
|
||||||
#include "doc/slice.h"
|
#include "doc/slice.h"
|
||||||
#include "doc/sprite.h"
|
#include "doc/sprite.h"
|
||||||
#include "fmt/format.h"
|
#include "fmt/format.h"
|
||||||
|
|
@ -153,12 +154,14 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
|
||||||
// Handle "Auto Select Layer"
|
// Handle "Auto Select Layer"
|
||||||
if (editor->isAutoSelectLayer()) {
|
if (editor->isAutoSelectLayer()) {
|
||||||
gfx::PointF cursor = editor->screenToEditorF(msg->position());
|
gfx::PointF cursor = editor->screenToEditorF(msg->position());
|
||||||
ColorPicker picker;
|
doc::RenderPlan plan;
|
||||||
picker.pickColor(site, cursor, editor->projection(), ColorPicker::FromComposition);
|
plan.addLayer(site.sprite()->root(), site.frame());
|
||||||
|
doc::CelList cels;
|
||||||
|
site.sprite()->pickCels(cursor, plan, cels);
|
||||||
|
|
||||||
const view::RealRange& range = context->range();
|
const view::RealRange& range = context->range();
|
||||||
if (picker.layer() && !range.contains(picker.layer())) {
|
if (!cels.empty() && !range.contains(cels.front()->layer())) {
|
||||||
layer = picker.layer();
|
layer = cels.front()->layer();
|
||||||
if (layer) {
|
if (layer) {
|
||||||
editor->setLayer(layer);
|
editor->setLayer(layer);
|
||||||
editor->flashCurrentLayer();
|
editor->flashCurrentLayer();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2019-2023 Igara Studio S.A.
|
// Copyright (C) 2019-2025 Igara Studio S.A.
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
// the End-User License Agreement for Aseprite.
|
// the End-User License Agreement for Aseprite.
|
||||||
|
|
@ -50,11 +50,9 @@ TaskWidget::TaskWidget(const Type type, base::task::func_t&& func)
|
||||||
}
|
}
|
||||||
else if (m_progressBar.parent()) {
|
else if (m_progressBar.parent()) {
|
||||||
float v = m_task.progress();
|
float v = m_task.progress();
|
||||||
if (v > 0.0f) {
|
if (v > 0.0f)
|
||||||
TRACEARGS("progressBar setValue", int(std::clamp(v * 100.0f, 0.0f, 100.0f)));
|
|
||||||
m_progressBar.setValue(int(std::clamp(v * 100.0f, 0.0f, 100.0f)));
|
m_progressBar.setValue(int(std::clamp(v * 100.0f, 0.0f, 100.0f)));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
m_monitorTimer.start();
|
m_monitorTimer.start();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// Aseprite Document Library
|
// Aseprite Document Library
|
||||||
// Copyright (C) 2018-2024 Igara Studio S.A.
|
// Copyright (C) 2018-2025 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
|
|
@ -656,9 +656,9 @@ void Sprite::remapTilemaps(const Tileset* tileset, const Remap& remap)
|
||||||
// Drawing
|
// Drawing
|
||||||
|
|
||||||
void Sprite::pickCels(const gfx::PointF& pos,
|
void Sprite::pickCels(const gfx::PointF& pos,
|
||||||
const int opacityThreshold,
|
|
||||||
const RenderPlan& plan,
|
const RenderPlan& plan,
|
||||||
CelList& cels) const
|
CelList& cels,
|
||||||
|
const int opacityThreshold) const
|
||||||
{
|
{
|
||||||
// Iterate cels in reversed order (from the front-most to the
|
// Iterate cels in reversed order (from the front-most to the
|
||||||
// bottom-most) so we pick first visible cel in the given position.
|
// bottom-most) so we pick first visible cel in the given position.
|
||||||
|
|
|
||||||
|
|
@ -212,9 +212,9 @@ public:
|
||||||
void remapImages(const Remap& remap);
|
void remapImages(const Remap& remap);
|
||||||
void remapTilemaps(const Tileset* tileset, const Remap& remap);
|
void remapTilemaps(const Tileset* tileset, const Remap& remap);
|
||||||
void pickCels(const gfx::PointF& pos,
|
void pickCels(const gfx::PointF& pos,
|
||||||
const int opacityThreshold,
|
|
||||||
const RenderPlan& plan,
|
const RenderPlan& plan,
|
||||||
CelList& cels) const;
|
CelList& cels,
|
||||||
|
const int opacityThreshold = 1) const;
|
||||||
|
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
// Iterators
|
// Iterators
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// Aseprite Steam Wrapper
|
// Aseprite Steam Wrapper
|
||||||
// Copyright (c) 2020-2024 Igara Studio S.A.
|
// Copyright (c) 2020-2025 Igara Studio S.A.
|
||||||
// Copyright (c) 2016 David Capello
|
// Copyright (c) 2016 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
|
|
@ -153,8 +153,6 @@ public:
|
||||||
|
|
||||||
CallbackMsg_t msg;
|
CallbackMsg_t msg;
|
||||||
if (SteamAPI_ManualDispatch_GetNextCallback(m_pipe, &msg)) {
|
if (SteamAPI_ManualDispatch_GetNextCallback(m_pipe, &msg)) {
|
||||||
// TRACEARGS("SteamAPI_ManualDispatch_GetNextCallback", msg.callback);
|
|
||||||
|
|
||||||
bool disconnected = false;
|
bool disconnected = false;
|
||||||
switch (msg.callback) {
|
switch (msg.callback) {
|
||||||
case kSteamServersDisconnected:
|
case kSteamServersDisconnected:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue