VirtualBox

Changeset 49868 in vbox for trunk/src/VBox/HostServices


Ignore:
Timestamp:
Dec 10, 2013 2:49:04 PM (11 years ago)
Author:
vboxsync
Message:

crOpenGL: fix img positioning for retina/osx

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/VBox

  • trunk/src/VBox/HostServices/SharedOpenGL/LICENSE

  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m

    r49294 r49868  
    950950
    951951    DEBUG_MSG(("OVIW(%p): reshape\n", (void*)self));
    952 
    953     /* Getting the right screen coordinates of the parents frame is a little bit
    954      * complicated. */
     952   
    955953    parentFrame = [m_pParentView frame];
    956     parentPos = [[m_pParentView window] convertBaseToScreen:[[m_pParentView superview] convertPointToBase:NSMakePoint(parentFrame.origin.x, parentFrame.origin.y + parentFrame.size.height)]];
    957     parentFrame.origin.x = parentPos.x;
    958     parentFrame.origin.y = parentPos.y;
    959 
    960     /* Calculate the new screen coordinates of the overlay window. */
     954    DEBUG_MSG(("FIXED parentFrame [%f:%f], [%f:%f]\n", parentFrame.origin.x, parentFrame.origin.y, parentFrame.size.width, parentFrame.size.height));   
     955    parentPos = parentFrame.origin;
     956    parentPos.y += parentFrame.size.height;
     957    DEBUG_MSG(("FIXED(view) parentPos [%f:%f]\n", parentPos.x, parentPos.y));
     958    parentPos = [m_pParentView convertPoint:parentPos toView:nil];
     959    DEBUG_MSG(("FIXED parentPos(win) [%f:%f]\n", parentPos.x, parentPos.y));
     960    parentPos = [[m_pParentView window] convertBaseToScreen:parentPos];
     961    DEBUG_MSG(("FIXED parentPos(screen) [%f:%f]\n", parentPos.x, parentPos.y));
     962    parentFrame.origin = parentPos;
     963   
    961964    childPos = NSMakePoint(m_Pos.x, m_Pos.y + m_Size.height);
    962     childPos = [[m_pParentView window] convertBaseToScreen:[[m_pParentView superview] convertPointToBase:childPos]];
    963 
    964     /* Make a frame out of it. */
     965    DEBUG_MSG(("FIXED(view) childPos [%f:%f]\n", childPos.x, childPos.y));
     966    childPos = [m_pParentView convertPoint:childPos toView:nil];
     967    DEBUG_MSG(("FIXED(win) childPos [%f:%f]\n", childPos.x, childPos.y));
     968    childPos = [[m_pParentView window] convertBaseToScreen:childPos];
     969    DEBUG_MSG(("FIXED childPos(screen) [%f:%f]\n", childPos.x, childPos.y));
    965970    childFrame = NSMakeRect(childPos.x, childPos.y, m_Size.width, m_Size.height);
     971    DEBUG_MSG(("FIXED childFrame [%f:%f], [%f:%f]\n", childFrame.origin.x, childFrame.origin.y, childFrame.size.width, childFrame.size.height));       
    966972
    967973    /* We have to make sure that the overlay window will not be displayed out
     
    983989         newFrame.origin.x, newFrame.origin.y,
    984990         newFrame.size.width, newFrame.size.height));
    985    
     991
    986992    /* Later we have to correct the texture position in the case the window is
    987993     * out of the parents window frame. So save the shift values for later use. */
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