From 8af0f3d41a7734c7a9428fac3dfd09eab3772cf3 Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Mar 01 2020 07:04:41 +0000 Subject: draft: degrade underlayer for nonaffine transforms --- diff --git a/synfig-core/src/synfig/rendering/common/optimizer/optimizerdraft.cpp b/synfig-core/src/synfig/rendering/common/optimizer/optimizerdraft.cpp index 2ba7368..80d3f31 100644 --- a/synfig-core/src/synfig/rendering/common/optimizer/optimizerdraft.cpp +++ b/synfig-core/src/synfig/rendering/common/optimizer/optimizerdraft.cpp @@ -98,14 +98,16 @@ OptimizerDraftTransformation::run(const RunParams ¶ms) const { if (TaskTransformation::Handle transformation = TaskTransformation::Handle::cast_dynamic(params.ref_task)) { + const bool affine = transformation->get_transformation().type_is(); + const Real supersample_max = affine ? 1 : 0.5; if ( transformation->interpolation != Color::INTERPOLATION_NEAREST - || approximate_greater_lp(transformation->supersample[0], 1.0) - || approximate_greater_lp(transformation->supersample[1], 1.0) ) + || approximate_greater_lp(transformation->supersample[0], supersample_max) + || approximate_greater_lp(transformation->supersample[1], supersample_max) ) { transformation = TaskTransformation::Handle::cast_dynamic( transformation->clone() ); transformation->interpolation = Color::INTERPOLATION_NEAREST; - transformation->supersample[0] = std::min(transformation->supersample[0], 1.0); - transformation->supersample[1] = std::min(transformation->supersample[1], 1.0); + transformation->supersample[0] = std::min(transformation->supersample[0], supersample_max); + transformation->supersample[1] = std::min(transformation->supersample[1], supersample_max); apply(params, transformation); } }