diff --git a/inc/thorvg.h b/inc/thorvg.h index ab3cb976..f7396050 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -668,7 +668,7 @@ public: * * @warning It's not allowed to change the viewport during Canvas::push() - Canvas::sync() or Canvas::update() - Canvas::sync(). * - * @note The specified viewport region will be intersected with the target region. + * @note When resetting the target, the viewport will also be reset to the target size. * @note Experimental API */ virtual Result viewport(int32_t x, int32_t y, int32_t w, int32_t h) noexcept; diff --git a/src/bindings/capi/thorvg_capi.h b/src/bindings/capi/thorvg_capi.h index a8451920..d4ebfe1a 100644 --- a/src/bindings/capi/thorvg_capi.h +++ b/src/bindings/capi/thorvg_capi.h @@ -761,7 +761,7 @@ TVG_API Tvg_Result tvg_canvas_sync(Tvg_Canvas* canvas); * * \warning It's not allowed to change the viewport during tvg_canvas_update() - tvg_canvas_sync() or tvg_canvas_push() - tvg_canvas_sync(). * -* \note The specified viewport region will be intersected with the target region. +* \note When resetting the target, the viewport will also be reset to the target size. * \note Experimental API * \see tvg_swcanvas_set_target() */ diff --git a/src/renderer/tvgGlCanvas.cpp b/src/renderer/tvgGlCanvas.cpp index 9e568a72..211dbb58 100644 --- a/src/renderer/tvgGlCanvas.cpp +++ b/src/renderer/tvgGlCanvas.cpp @@ -68,7 +68,7 @@ Result GlCanvas::target(int32_t id, uint32_t w, uint32_t h) noexcept if (!renderer) return Result::MemoryCorruption; if (!renderer->target(id, w, h)) return Result::Unknown; - Canvas::pImpl->vport.intersect({0, 0, (int32_t)w, (int32_t)h}); + Canvas::pImpl->vport = {0, 0, (int32_t)w, (int32_t)h}; renderer->viewport(Canvas::pImpl->vport); //Paints must be updated again with this new target. diff --git a/src/renderer/tvgSwCanvas.cpp b/src/renderer/tvgSwCanvas.cpp index 24350ef1..52d85d83 100644 --- a/src/renderer/tvgSwCanvas.cpp +++ b/src/renderer/tvgSwCanvas.cpp @@ -87,7 +87,7 @@ Result SwCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t if (!renderer) return Result::MemoryCorruption; if (!renderer->target(buffer, stride, w, h, static_cast(cs))) return Result::InvalidArguments; - Canvas::pImpl->vport.intersect({0, 0, (int32_t)w, (int32_t)h}); + Canvas::pImpl->vport = {0, 0, (int32_t)w, (int32_t)h}; renderer->viewport(Canvas::pImpl->vport); //Paints must be updated again with this new target. diff --git a/src/renderer/tvgWgCanvas.cpp b/src/renderer/tvgWgCanvas.cpp index 5391de0a..7db77f6d 100644 --- a/src/renderer/tvgWgCanvas.cpp +++ b/src/renderer/tvgWgCanvas.cpp @@ -63,7 +63,7 @@ Result WgCanvas::target(void* window, uint32_t w, uint32_t h) noexcept if (!renderer) return Result::MemoryCorruption; if (!renderer->target(window, w, h)) return Result::Unknown; - Canvas::pImpl->vport.intersect({0, 0, (int32_t)w, (int32_t)h}); + Canvas::pImpl->vport = {0, 0, (int32_t)w, (int32_t)h}; renderer->viewport(Canvas::pImpl->vport); //Paints must be updated again with this new target.