Merge pull request #2837 from manongjohn/selection_pivot_fix
Selection pivot fix
This commit is contained in:
commit
6555c94eb2
2 changed files with 11 additions and 10 deletions
|
@ -972,6 +972,12 @@ void SelectionTool::updateAction(TPointD pos, const TMouseEvent &e) {
|
|||
}
|
||||
maxDist = 5 * pixelSize;
|
||||
maxDist2 = maxDist * maxDist;
|
||||
if (!isLevelType() && !isSelectedFramesType() &&
|
||||
tdistance2(getCenter(), pos) < maxDist2) {
|
||||
m_what = MOVE_CENTER;
|
||||
m_cursorId = ToolCursor::PointingHandCursor;
|
||||
return;
|
||||
}
|
||||
if (tdistance2(bbox.getP00(), pos) < maxDist2 ||
|
||||
tdistance2(bbox.getP11(), pos) < maxDist2 ||
|
||||
tdistance2(bbox.getP01(), pos) < maxDist2 ||
|
||||
|
@ -1021,12 +1027,6 @@ void SelectionTool::updateAction(TPointD pos, const TMouseEvent &e) {
|
|||
}
|
||||
return;
|
||||
}
|
||||
if (!isLevelType() && !isSelectedFramesType() &&
|
||||
tdistance2(getCenter(), pos) < maxDist2) {
|
||||
m_what = MOVE_CENTER;
|
||||
m_cursorId = ToolCursor::PointingHandCursor;
|
||||
return;
|
||||
}
|
||||
TPointD hpos = bbox.getP10() - TPointD(14 * pixelSize, 15 * pixelSize);
|
||||
TRectD rect(hpos - TPointD(14 * pixelSize, 5 * pixelSize),
|
||||
hpos + TPointD(14 * pixelSize, 5 * pixelSize));
|
||||
|
|
|
@ -1423,6 +1423,7 @@ void VectorSelectionTool::clearSelectedStrokes() {
|
|||
m_strokeSelection.selectNone();
|
||||
m_levelSelection.styles().clear();
|
||||
m_deformValues.reset();
|
||||
m_centers.clear();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -1710,8 +1711,8 @@ void VectorSelectionTool::draw() {
|
|||
|
||||
glPushMatrix();
|
||||
|
||||
if (m_strokeSelection.isEmpty()) // o_o WTF!?
|
||||
m_bboxs.clear(), m_centers.clear(); //
|
||||
if (m_strokeSelection.isEmpty()) // o_o WTF!?
|
||||
m_bboxs.clear(); //
|
||||
|
||||
// common draw
|
||||
if (getBBoxsCount() > 0) drawCommandHandle(vi.getPointer());
|
||||
|
@ -1762,7 +1763,6 @@ bool VectorSelectionTool::isSelectionEmpty() {
|
|||
|
||||
void VectorSelectionTool::computeBBox() {
|
||||
m_bboxs.clear();
|
||||
m_centers.clear();
|
||||
|
||||
TVectorImageP vi = getImage(false);
|
||||
if (!vi) return;
|
||||
|
@ -1822,7 +1822,8 @@ void VectorSelectionTool::computeBBox() {
|
|||
FourPoints bbox;
|
||||
bbox = newBbox;
|
||||
m_bboxs.push_back(bbox);
|
||||
m_centers.push_back(0.5 * (bbox.getP11() + bbox.getP00()));
|
||||
if (getCenter() == TPointD())
|
||||
m_centers.push_back(0.5 * (bbox.getP11() + bbox.getP00()));
|
||||
}
|
||||
|
||||
++m_selectionCount;
|
||||
|
|
Loading…
Reference in a new issue