[Title] Set threshold for SmartZoom.
[Issue#] N_SE-43667
[Problem] The SmartZoom seems inconsistent in the Open_Source_Announcement.
[Cause] The zoomable area is similar with contents size, so the scale factor is changed a little.
[Solution] Set threshold (0.1) for SmartZoom to prevent to zooming for small amount of changing.
Change-Id: I91d8fa72f72859cc41ada133d54e612bf700c878
// Scale to 2.0 if target scale factor is same as current scale factor.
// If width of area is same as width of contents and contents is fitted to the viewport now,
// the current scale factor and target scale factor can be same.
- if (fabs(pageClientImpl->scaleFactor() - targetScale) < numeric_limits<float>::epsilon()) {
+ if (fabs(pageClientImpl->scaleFactor() - targetScale) < s_scaleThreshold) {
targetScale = 2;
newContentsRect = FloatRect(target, FloatSize(viewportRect.width() / targetScale, viewportRect.height() / targetScale));
} else {
static const int s_numberOfCosineValue = 17;
static const float s_cosine[s_numberOfCosineValue];
static const int s_widthMargin = 4;
+ static const float s_scaleThreshold = 0.1;
static Eina_Bool scaleAnimatorCallback(void*);