Merge branch 'main' into beta

This commit is contained in:
David Capello 2021-08-23 14:09:44 -03:00
commit 54a6ef5eb7
5 changed files with 24 additions and 5 deletions

View File

@ -892,7 +892,8 @@ void DocExporter::captureSamples(Samples& samples,
.outerTagName(outerTag ? outerTag->name(): "")
.frame(outputFrame)
.tagFrame(innerTag ? frame - innerTag->fromFrame():
outputFrame);
outputFrame)
.duration(sprite->frameDuration(frame));
++outputFrame;
std::string filename = filename_formatter(format, fnInfo);

View File

@ -613,7 +613,8 @@ static void ase_file_write_start_chunk(FILE* f, dio::AsepriteFrameHeader* frame_
chunk->type = type;
chunk->start = ftell(f);
fseek(f, chunk->start+6, SEEK_SET);
fputl(0, f);
fputw(0, f);
}
static void ase_file_write_close_chunk(FILE* f, dio::AsepriteChunk* chunk)

View File

@ -112,6 +112,7 @@ std::string filename_formatter(
base::replace_string(output, "{layer}", info.layerName());
base::replace_string(output, "{group}", info.groupName());
base::replace_string(output, "{slice}", info.sliceName());
base::replace_string(output, "{duration}", std::to_string(info.duration()));
if (replaceFrame) {
base::replace_string(output, "{tag}", info.innerTagName());

View File

@ -24,6 +24,7 @@ namespace app {
const std::string& sliceName() const { return m_sliceName; }
int frame() const { return m_frame; }
int tagFrame() const { return m_tagFrame; }
int duration() const { return m_duration; }
FilenameInfo& filename(const std::string& value) {
m_filename = value;
@ -65,6 +66,11 @@ namespace app {
return *this;
}
FilenameInfo& duration(int value) {
m_duration = value;
return *this;
}
private:
std::string m_filename;
std::string m_layerName;
@ -74,6 +80,7 @@ namespace app {
std::string m_sliceName;
int m_frame;
int m_tagFrame;
int m_duration;
};
// Returns the information inside {frame} tag.

View File

@ -630,9 +630,18 @@ void BrushPreview::createCrosshairCursor(ui::Graphics* g,
}
}
if (requireLittleCenterDot) {
cursorSurface->putPixel(
(k == 0x100 || k == 0x300 ? black: white),
cursorBounds.w/2, cursorBounds.h/2);
if (m_type & CROSSHAIR) {
if (k & (0x100 | 0x200)) { // 0x100 or 0x200
cursorSurface->putPixel(
(k & 0x100 ? black: white),
cursorBounds.w/2, cursorBounds.h/2);
}
}
else { // 0x300 or 0x301
cursorSurface->putPixel(
(k == 0x300 ? black: white),
cursorBounds.w/2, cursorBounds.h/2);
}
}
cursor = g_bwCursors[k] =