VirtualBox

Changeset 57140 in vbox


Ignore:
Timestamp:
Jul 31, 2015 12:11:27 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101882
Message:

FE/Qt: 3635: Scaling-feature caused regression for scaling-mode using common way to determine scaling transformation type; Ways should be independent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r56359 r57140  
    294294
    295295    /** Returns the transformation mode corresponding to the passed @a dScaleFactor and ScalingOptimizationType. */
    296     static Qt::TransformationMode transformationMode(double dScaleFactor, ScalingOptimizationType type);
     296    static Qt::TransformationMode transformationMode(ScalingOptimizationType type, double dScaleFactor = 0);
    297297
    298298    /** Erases corresponding @a rect with @a painter. */
     
    13471347        scaledImage = m_image.copy();
    13481348        /* And scaling the image to predefined scaled-factor: */
    1349         scaledImage = scaledImage.scaled(m_scaledSize, Qt::IgnoreAspectRatio,
    1350                                          transformationMode(m_dScaleFactor, scalingOptimizationType()));
     1349        switch (m_pMachineView->visualStateType())
     1350        {
     1351            case UIVisualStateType_Scale:
     1352                scaledImage = scaledImage.scaled(m_scaledSize, Qt::IgnoreAspectRatio,
     1353                                                 transformationMode(scalingOptimizationType()));
     1354                break;
     1355            default:
     1356                scaledImage = scaledImage.scaled(m_scaledSize, Qt::IgnoreAspectRatio,
     1357                                                 transformationMode(scalingOptimizationType(), m_dScaleFactor));
     1358                break;
     1359        }
    13511360    }
    13521361    /* Finally we are choosing image to paint from: */
     
    13881397        scaledImage = m_image.copy();
    13891398        /* And scaling the image to predefined scaled-factor: */
    1390         scaledImage = scaledImage.scaled(m_scaledSize, Qt::IgnoreAspectRatio,
    1391                                          transformationMode(m_dScaleFactor, scalingOptimizationType()));
     1399        switch (m_pMachineView->visualStateType())
     1400        {
     1401            case UIVisualStateType_Scale:
     1402                scaledImage = scaledImage.scaled(m_scaledSize, Qt::IgnoreAspectRatio,
     1403                                                 transformationMode(scalingOptimizationType()));
     1404                break;
     1405            default:
     1406                scaledImage = scaledImage.scaled(m_scaledSize, Qt::IgnoreAspectRatio,
     1407                                                 transformationMode(scalingOptimizationType(), m_dScaleFactor));
     1408                break;
     1409        }
    13921410    }
    13931411    /* Finally we are choosing image to paint from: */
     
    14451463
    14461464/* static */
    1447 Qt::TransformationMode UIFrameBufferPrivate::transformationMode(double dScaleFactor, ScalingOptimizationType type)
     1465Qt::TransformationMode UIFrameBufferPrivate::transformationMode(ScalingOptimizationType type, double dScaleFactor /* = 0 */)
    14481466{
    14491467    switch (type)
     
    14541472    }
    14551473    /* For integer-scaling we are choosing the 'Performance' optimization type ourselves: */
    1456     return floor(dScaleFactor) == dScaleFactor ? Qt::FastTransformation : Qt::SmoothTransformation;
     1474    return dScaleFactor && floor(dScaleFactor) == dScaleFactor ? Qt::FastTransformation : Qt::SmoothTransformation;;
    14571475}
    14581476
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette