Skip to content

Commit

Permalink
[TD]fix checkFit to use current scale
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed May 22, 2022
1 parent e1f2685 commit bfecd13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/Mod/TechDraw/App/DrawView.cpp
Expand Up @@ -388,20 +388,19 @@ bool DrawView::checkFit(void) const
}

//!check if View is too big for page
//should check if unscaled rect is too big for page
bool DrawView::checkFit(TechDraw::DrawPage* p) const
{
bool result = true;
double fudge = 1.1;

double width = 0.0;
double height = 0.0;
QRectF viewBox = getRect(); //rect is scaled
QRectF viewBox = getRect(); //rect is scaled
if (!viewBox.isValid()) {
result = true;
} else {
width = viewBox.width() / getScale(); //unscaled rect w x h
height = viewBox.height() / getScale();
width = viewBox.width(); //scaled rect w x h
height = viewBox.height();
width *= fudge;
height *= fudge;
if ( (width > p->getPageWidth()) ||
Expand Down
3 changes: 1 addition & 2 deletions src/Mod/TechDraw/TechDrawTools/TDToolsMovers.py
Expand Up @@ -36,8 +36,7 @@ def simpleViewMove(view, fromPage, toPage, copy):
for d in deps:
toPage.addView(d)

view.recompute() #update the view feature
App.ActiveDocument.recompute() #update views dependents if necessary
App.ActiveDocument.recompute() #update views & dependents if necessary
return

#move a section view, its Base View and all its dependents (items, dimensions, balloons, etc) of both from fromPage to toPage
Expand Down

0 comments on commit bfecd13

Please sign in to comment.