mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1125040: Use LayoutDeviceIntPoint for GetEventPoint r=botond
This commit is contained in:
parent
1330fc1496
commit
e0f914e704
@ -2095,15 +2095,15 @@ nsBoxFrame::WrapListsInRedirector(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
bool
|
||||
nsBoxFrame::GetEventPoint(WidgetGUIEvent* aEvent, nsPoint &aPoint) {
|
||||
nsIntPoint refPoint;
|
||||
LayoutDeviceIntPoint refPoint;
|
||||
bool res = GetEventPoint(aEvent, refPoint);
|
||||
aPoint = nsLayoutUtils::GetEventCoordinatesRelativeTo(
|
||||
aEvent, LayoutDeviceIntPoint::FromUntyped(refPoint), this);
|
||||
aEvent, refPoint, this);
|
||||
return res;
|
||||
}
|
||||
|
||||
bool
|
||||
nsBoxFrame::GetEventPoint(WidgetGUIEvent* aEvent, nsIntPoint &aPoint) {
|
||||
nsBoxFrame::GetEventPoint(WidgetGUIEvent* aEvent, LayoutDeviceIntPoint& aPoint) {
|
||||
NS_ENSURE_TRUE(aEvent, false);
|
||||
|
||||
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
|
||||
@ -2118,9 +2118,9 @@ nsBoxFrame::GetEventPoint(WidgetGUIEvent* aEvent, nsIntPoint &aPoint) {
|
||||
if (!touch) {
|
||||
return false;
|
||||
}
|
||||
aPoint = LayoutDeviceIntPoint::ToUntyped(touch->mRefPoint);
|
||||
aPoint = touch->mRefPoint;
|
||||
} else {
|
||||
aPoint = LayoutDeviceIntPoint::ToUntyped(aEvent->refPoint);
|
||||
aPoint = aEvent->refPoint;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -209,7 +209,8 @@ protected:
|
||||
bool GetEventPoint(mozilla::WidgetGUIEvent* aEvent, nsPoint& aPoint);
|
||||
// Gets the event coordinates relative to the widget offset associated with
|
||||
// this frame. Return true if a single valid point was found.
|
||||
bool GetEventPoint(mozilla::WidgetGUIEvent* aEvent, nsIntPoint& aPoint);
|
||||
bool GetEventPoint(mozilla::WidgetGUIEvent* aEvent,
|
||||
mozilla::LayoutDeviceIntPoint& aPoint);
|
||||
|
||||
protected:
|
||||
void RegUnregAccessKey(bool aDoReg);
|
||||
|
@ -1477,7 +1477,9 @@ nsMenuPopupFrame::GetConstraintRect(const nsRect& aAnchorRect,
|
||||
return screenRect;
|
||||
}
|
||||
|
||||
void nsMenuPopupFrame::CanAdjustEdges(int8_t aHorizontalSide, int8_t aVerticalSide, nsIntPoint& aChange)
|
||||
void nsMenuPopupFrame::CanAdjustEdges(int8_t aHorizontalSide,
|
||||
int8_t aVerticalSide,
|
||||
LayoutDeviceIntPoint& aChange)
|
||||
{
|
||||
int8_t popupAlign(mPopupAlignment);
|
||||
if (IsDirectionRTL()) {
|
||||
|
@ -366,7 +366,9 @@ public:
|
||||
// Later, when bug 357725 is implemented, we can make this adjust aChange by
|
||||
// the amount that the side can be resized, so that minimums and maximums
|
||||
// can be taken into account.
|
||||
void CanAdjustEdges(int8_t aHorizontalSide, int8_t aVerticalSide, nsIntPoint& aChange);
|
||||
void CanAdjustEdges(int8_t aHorizontalSide,
|
||||
int8_t aVerticalSide,
|
||||
mozilla::LayoutDeviceIntPoint& aChange);
|
||||
|
||||
// Return true if the popup is positioned relative to an anchor.
|
||||
bool IsAnchored() const { return mScreenXPos == -1 && mScreenYPos == -1; }
|
||||
|
@ -114,10 +114,11 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
// remember current mouse coordinates
|
||||
nsIntPoint refPoint;
|
||||
LayoutDeviceIntPoint refPoint;
|
||||
if (!GetEventPoint(aEvent, refPoint))
|
||||
return NS_OK;
|
||||
mMouseDownPoint = refPoint + aEvent->widget->WidgetToScreenOffset();
|
||||
mMouseDownPoint = refPoint +
|
||||
LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset());
|
||||
|
||||
// we're tracking
|
||||
mTrackingMouseMove = true;
|
||||
@ -162,11 +163,12 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext,
|
||||
|
||||
// retrieve the offset of the mousemove event relative to the mousedown.
|
||||
// The difference is how much the resize needs to be
|
||||
nsIntPoint refPoint;
|
||||
LayoutDeviceIntPoint refPoint;
|
||||
if (!GetEventPoint(aEvent, refPoint))
|
||||
return NS_OK;
|
||||
nsIntPoint screenPoint(refPoint + aEvent->widget->WidgetToScreenOffset());
|
||||
nsIntPoint mouseMove(screenPoint - mMouseDownPoint);
|
||||
LayoutDeviceIntPoint screenPoint = refPoint +
|
||||
LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset());
|
||||
LayoutDeviceIntPoint mouseMove(screenPoint - mMouseDownPoint);
|
||||
|
||||
// Determine which direction to resize by checking the dir attribute.
|
||||
// For windows and menus, ensure that it can be resized in that direction.
|
||||
|
@ -66,8 +66,8 @@ protected:
|
||||
static void RestoreOriginalSize(nsIContent* aContent);
|
||||
|
||||
protected:
|
||||
nsIntRect mMouseDownRect;
|
||||
nsIntPoint mMouseDownPoint;
|
||||
nsIntRect mMouseDownRect;
|
||||
LayoutDeviceIntPoint mMouseDownPoint;
|
||||
}; // class nsResizerFrame
|
||||
|
||||
#endif /* nsResizerFrame_h___ */
|
||||
|
Loading…
Reference in New Issue
Block a user