mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-27 21:19:18 +00:00
New "overlap" trace-policy for tools like Spray, Blur, and Jumble.
This commit is contained in:
parent
06403f3ace
commit
dbebaec92b
@ -443,7 +443,7 @@
|
||||
ink="paint"
|
||||
controller="freehand"
|
||||
pointshape="spray"
|
||||
tracepolicy="accumulative"
|
||||
tracepolicy="overlap"
|
||||
/>
|
||||
</group>
|
||||
|
||||
@ -578,7 +578,7 @@
|
||||
controller="freehand"
|
||||
pointshape="pen"
|
||||
intertwine="as_lines"
|
||||
tracepolicy="accumulative"
|
||||
tracepolicy="overlap"
|
||||
default_pen_size="16"
|
||||
/>
|
||||
<tool id="jumble"
|
||||
@ -587,7 +587,7 @@
|
||||
controller="freehand"
|
||||
pointshape="pen"
|
||||
intertwine="as_lines"
|
||||
tracepolicy="accumulative"
|
||||
tracepolicy="overlap"
|
||||
default_pen_size="16"
|
||||
/>
|
||||
</group>
|
||||
|
@ -215,13 +215,21 @@ void ToolLoopManager::doLoopStep(bool last_step)
|
||||
switch (m_toolLoop->getTracePolicy()) {
|
||||
|
||||
case TOOL_TRACE_POLICY_ACCUMULATE:
|
||||
// do nothing
|
||||
// Do nothing. We accumulate traces in the destination image.
|
||||
break;
|
||||
|
||||
case TOOL_TRACE_POLICY_LAST:
|
||||
// Copy source to destination (reset the previous trace). Useful
|
||||
// for tools like Line and Ellipse tools (we kept the last trace only).
|
||||
image_clear(m_toolLoop->getDstImage(), 0);
|
||||
image_copy(m_toolLoop->getDstImage(), m_toolLoop->getSrcImage(), 0, 0);
|
||||
break;
|
||||
|
||||
case TOOL_TRACE_POLICY_OVERLAP:
|
||||
// Copy destination to source (yes, destination to source). In
|
||||
// this way each new trace overlaps the previous one.
|
||||
image_copy(m_toolLoop->getSrcImage(), m_toolLoop->getDstImage(), 0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
// Get the modified area in the sprite with this intertwined set of points
|
||||
|
@ -51,6 +51,7 @@ enum ToolTracePolicy
|
||||
{
|
||||
TOOL_TRACE_POLICY_ACCUMULATE,
|
||||
TOOL_TRACE_POLICY_LAST,
|
||||
TOOL_TRACE_POLICY_OVERLAP,
|
||||
};
|
||||
|
||||
// Class used to paint directly in the destination image (loop->getDstImage())
|
||||
|
@ -224,6 +224,8 @@ void ToolBox::loadToolProperties(TiXmlElement* xmlTool, Tool* tool, int button,
|
||||
tracepolicy_value = TOOL_TRACE_POLICY_ACCUMULATE;
|
||||
else if (strcmp(tracepolicy, "last") == 0)
|
||||
tracepolicy_value = TOOL_TRACE_POLICY_LAST;
|
||||
else if (strcmp(tracepolicy, "overlap") == 0)
|
||||
tracepolicy_value = TOOL_TRACE_POLICY_OVERLAP;
|
||||
else
|
||||
throw ase_exception("Invalid trace-policy '%s' specified in '%s' tool.\n", tracepolicy, tool_id);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user