parent
7d84bd2f7b
commit
4f195f5629
@ -12,7 +12,8 @@ CaptureArea::CaptureArea(const QRect &rect, const Settings &settings)
|
||||
{
|
||||
}
|
||||
|
||||
TaskPtr CaptureArea::task(const QPixmap &pixmap) const
|
||||
TaskPtr CaptureArea::task(const QPixmap &pixmap,
|
||||
const QPoint &pixmapOffset) const
|
||||
{
|
||||
if (pixmap.isNull() || !isValid())
|
||||
return {};
|
||||
@ -21,7 +22,7 @@ TaskPtr CaptureArea::task(const QPixmap &pixmap) const
|
||||
task->generation = generation_;
|
||||
task->useHunspell = useHunspell_;
|
||||
task->captured = pixmap.copy(rect_);
|
||||
task->capturePoint = rect_.topLeft();
|
||||
task->capturePoint = pixmapOffset + rect_.topLeft();
|
||||
task->sourceLanguage = sourceLanguage_;
|
||||
if (task->sourceLanguage.isEmpty())
|
||||
task->error += QObject::tr("No source language set");
|
||||
|
@ -11,7 +11,7 @@ class CaptureArea
|
||||
{
|
||||
public:
|
||||
CaptureArea(const QRect& rect, const Settings& settings);
|
||||
TaskPtr task(const QPixmap& pixmap) const;
|
||||
TaskPtr task(const QPixmap& pixmap, const QPoint& pixmapOffset) const;
|
||||
|
||||
void setGeneration(uint generation);
|
||||
bool isValid() const;
|
||||
|
@ -339,7 +339,7 @@ void CaptureAreaSelector::customize(const std::shared_ptr<CaptureArea> &area)
|
||||
edited_ = area;
|
||||
editor_->show();
|
||||
const auto topLeft = service::geometry::cornerAtPoint(
|
||||
area->rect().center(), editor_->size(), geometry());
|
||||
area->rect().center(), editor_->size(), QRect({}, size()));
|
||||
editor_->move(topLeft);
|
||||
update();
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ void Capturer::selected(const CaptureArea &area)
|
||||
selector_->hide();
|
||||
|
||||
SOFT_ASSERT(!pixmap_.isNull(), return manager_.captureCanceled())
|
||||
auto task = area.task(pixmap_);
|
||||
auto task = area.task(pixmap_, pixmapOffset_);
|
||||
if (task)
|
||||
manager_.captured(task);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user