Skip to content

Commit

Permalink
Export items out of scene rect #90
Browse files Browse the repository at this point in the history
  • Loading branch information
DamirPorobic committed Jun 12, 2020
1 parent 8937625 commit 1c0aecb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Release 0.3.0
* New: Tabs for images. ([#48](https://github.com/ksnip/kImageAnnotator/issues/48))
* New: Add option to translate UI. ([#54](https://github.com/ksnip/kImageAnnotator/issues/54))
* New: Saved image expand to include annotations out of border. ([#90](https://github.com/ksnip/kImageAnnotator/issues/90))

## Release 0.2.1
* Fixed: Edit border around text box doesn't disappear when done with editing. ([#71](https://github.com/ksnip/kImageAnnotator/issues/71))
Expand Down
6 changes: 5 additions & 1 deletion src/annotations/core/AnnotationArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,17 @@ QImage AnnotationArea::image()

mItemModifier->clear();

setSceneRect({}); // Unset scene rect to cover all items

QImage image(sceneRect().size().toSize(), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::transparent);
image.fill(Qt::white);

QPainter painter(&image);
painter.setRenderHint(QPainter::Antialiasing);
render(&painter);

setSceneRect(mImage->boundingRect()); // Reset scene rect

return image;
}

Expand Down

0 comments on commit 1c0aecb

Please sign in to comment.