-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix of #522 #523
Fix of #522 #523
Conversation
This fixes original issue Qucs#522. Diagram markers are taken into account when calculating selected area width and height.
1. Method getSelAreaWidthAndHeight() moved from Schematic to ImageWriter class; 2. Duplicated code in ImageWriter moved to UpdateMinMax() method
thanks, seems to work almost as expected. |
Diagram::paint() was splitted into two methods: Diagram::painDiagram() and Diagram::paintMarkers(). It allow to print diagram without markers and supress marker lines when only diagram is selcted and markers are outside diagram.
@in3otd I have divided |
printing selected object seems to work well now, thanks.
|
1. Schematic->UsedX2,UsedY2 were not reliable in some cases. Replaced by sizeOfAll() method. 2. Removed two forgotten commented lines
I have corrected image size determination method. Previous one was unreliable in some cases. See the latest commit. |
thanks, it's quite better, but not yet perfect, sorry... In the example project linked above
Besides, if printing the entire schematic, labels on the bottom, below any components, as in the example project linked above do not have any margin below them, while the margin is correctly present on the other sides. |
Current implementation inherits label bounding box determination method from the legacy code |
1. Wire label bounding box is determined correctly. Introduced WireLabel::getLableBounding() method. It is used for selected labels and Schematic::sizeOfAll() method. 2. Corrected wire size determination for selected wires.
@in3otd , I have modified legacy code. Now label bounding box should be determined correctly. Here are two examples of exported images. The first uses "Export selected" and the second uses "Export All": |
thanks for the quick fix. While testing I noticed one inconsistency: the bounding box calculations take into account labels only if their associated wire is selected while the painting routine print selected labels even if the associated wire is not selected. The end result is that wire labels can be cut if the corresponding wire is not selected. Another details is that if you toggle the Original size checkbox while Export selected only is checked, the Width/Height lines show the full schematic size and not just the selected components area size. I've pushed a PR to your branch with the small fixes for these things, please take a look. |
Additions to 522 fix
@in3otd , Your code works as expected. If you have no other additions, this PR could be merged after CI will be passed. |
Seems good to me as well. Merging. |
This PR contains fix for #522 and some refactoring at the
ImageWriter
class. @in3otd , please check on your side.