Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

fix lineargradientfx handles (#2891)

shun-iwasawaca556f855042
diff --git a/toonz/sources/tnztools/edittoolgadgets.cpp b/toonz/sources/tnztools/edittoolgadgets.cpp
index ffad94e40..ff066070e 100644
--- a/toonz/sources/tnztools/edittoolgadgets.cpp
+++ b/toonz/sources/tnztools/edittoolgadgets.cpp
@@ -1510,8 +1510,9 @@ void LinearRangeFxGadget::leftButtonDrag(const TPointD &pos,
if (m_targetPos != m_anotherPos && e.isShiftPressed()) {
TPointD vecA = m_targetPos - m_anotherPos;
TPointD vecB = m_targetPos + d - m_anotherPos;
- double ratio = std::min(vecB.x / vecA.x, vecB.y / vecA.y);
- d = vecA * (ratio - 1.0);
+ d = vecA * ((vecA.x * vecB.x + vecA.y * vecB.y) /
+ (vecA.x * vecA.x + vecA.y * vecA.y) -
+ 1.0);
}
setValue(target, m_targetPos + d);
diff --git a/toonz/sources/toonzlib/columnfan.cpp b/toonz/sources/toonzlib/columnfan.cpp
index acd4e22ea..96732a3bd 100644
--- a/toonz/sources/toonzlib/columnfan.cpp
+++ b/toonz/sources/toonzlib/columnfan.cpp
@@ -183,7 +183,6 @@ void ColumnFan::loadData(TIStream &is) {
void ColumnFan::rollLeftFoldedState(int index, int count) {
assert(index >= 0);
- assert(count > 1);
int columnCount = m_columns.size();
if (columnCount <= index) return;
if (index + count - 1 > columnCount) count = columnCount - index + 1;
@@ -210,7 +209,6 @@ void ColumnFan::rollLeftFoldedState(int index, int count) {
void ColumnFan::rollRightFoldedState(int index, int count) {
assert(index >= 0);
- assert(count > 1);
int columnCount = m_columns.size();
if (columnCount <= index) return;