From 32d4797ac62458d99679f32aebf203e55fc45462 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 3 Dec 2015 16:26:10 -1000 Subject: [PATCH] signed window coordinates for cocoa --- lib/mac/WindowCocoa.mm | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/mac/WindowCocoa.mm b/lib/mac/WindowCocoa.mm index 94c7d3f..441a953 100644 --- a/lib/mac/WindowCocoa.mm +++ b/lib/mac/WindowCocoa.mm @@ -461,9 +461,9 @@ static inline boo::EMouseButton getButton(NSEvent* event) NSRect frame = [parentView frame]; boo::SWindowCoord coord = { - {(unsigned)(liw.x * pixelFactor), (unsigned)(liw.y * pixelFactor)}, - {(unsigned)liw.x, (unsigned)liw.y}, - {(float)(liw.x / frame.size.width), (float)(liw.y / frame.size.height)} + {int(liw.x * pixelFactor), int(liw.y * pixelFactor)}, + {int(liw.x), int(liw.y)}, + {float(liw.x / frame.size.width), float(liw.y / frame.size.height)} }; booContext->m_callback->mouseDown(coord, boo::EMouseButton::Primary, getMod([theEvent modifierFlags])); @@ -478,9 +478,9 @@ static inline boo::EMouseButton getButton(NSEvent* event) NSRect frame = [parentView frame]; boo::SWindowCoord coord = { - {(unsigned)(liw.x * pixelFactor), (unsigned)(liw.y * pixelFactor)}, - {(unsigned)liw.x, (unsigned)liw.y}, - {(float)(liw.x / frame.size.width), (float)(liw.y / frame.size.height)} + {int(liw.x * pixelFactor), int(liw.y * pixelFactor)}, + {int(liw.x), int(liw.y)}, + {float(liw.x / frame.size.width), float(liw.y / frame.size.height)} }; booContext->m_callback->mouseUp(coord, boo::EMouseButton::Primary, getMod([theEvent modifierFlags])); @@ -495,9 +495,9 @@ static inline boo::EMouseButton getButton(NSEvent* event) NSRect frame = [parentView frame]; boo::SWindowCoord coord = { - {(unsigned)(liw.x * pixelFactor), (unsigned)(liw.y * pixelFactor)}, - {(unsigned)liw.x, (unsigned)liw.y}, - {(float)(liw.x / frame.size.width), (float)(liw.y / frame.size.height)} + {int(liw.x * pixelFactor), int(liw.y * pixelFactor)}, + {int(liw.x), int(liw.y)}, + {float(liw.x / frame.size.width), float(liw.y / frame.size.height)} }; booContext->m_callback->mouseDown(coord, boo::EMouseButton::Secondary, getMod([theEvent modifierFlags])); @@ -512,9 +512,9 @@ static inline boo::EMouseButton getButton(NSEvent* event) NSRect frame = [parentView frame]; boo::SWindowCoord coord = { - {(unsigned)(liw.x * pixelFactor), (unsigned)(liw.y * pixelFactor)}, - {(unsigned)liw.x, (unsigned)liw.y}, - {(float)(liw.x / frame.size.width), (float)(liw.y / frame.size.height)} + {int(liw.x * pixelFactor), int(liw.y * pixelFactor)}, + {int(liw.x), int(liw.y)}, + {float(liw.x / frame.size.width), float(liw.y / frame.size.height)} }; booContext->m_callback->mouseUp(coord, boo::EMouseButton::Secondary, getMod([theEvent modifierFlags])); @@ -532,9 +532,9 @@ static inline boo::EMouseButton getButton(NSEvent* event) NSRect frame = [parentView frame]; boo::SWindowCoord coord = { - {(unsigned)(liw.x * pixelFactor), (unsigned)(liw.y * pixelFactor)}, - {(unsigned)liw.x, (unsigned)liw.y}, - {(float)(liw.x / frame.size.width), (float)(liw.y / frame.size.height)} + {int(liw.x * pixelFactor), int(liw.y * pixelFactor)}, + {int(liw.x), int(liw.y)}, + {float(liw.x / frame.size.width), float(liw.y / frame.size.height)} }; booContext->m_callback->mouseDown(coord, button, getMod([theEvent modifierFlags])); } @@ -551,9 +551,9 @@ static inline boo::EMouseButton getButton(NSEvent* event) NSRect frame = [parentView frame]; boo::SWindowCoord coord = { - {(unsigned)(liw.x * pixelFactor), (unsigned)(liw.y * pixelFactor)}, - {(unsigned)liw.x, (unsigned)liw.y}, - {(float)(liw.x / frame.size.width), (float)(liw.y / frame.size.height)} + {int(liw.x * pixelFactor), int(liw.y * pixelFactor)}, + {int(liw.x), int(liw.y)}, + {float(liw.x / frame.size.width), float(liw.y / frame.size.height)} }; booContext->m_callback->mouseUp(coord, button, getMod([theEvent modifierFlags])); } @@ -569,9 +569,9 @@ static inline boo::EMouseButton getButton(NSEvent* event) NSRect frame = [parentView frame]; boo::SWindowCoord coord = { - {(unsigned)(liw.x * pixelFactor), (unsigned)(liw.y * pixelFactor)}, - {(unsigned)liw.x, (unsigned)liw.y}, - {(float)(liw.x / frame.size.width), (float)(liw.y / frame.size.height)} + {int(liw.x * pixelFactor), int(liw.y * pixelFactor)}, + {int(liw.x), int(liw.y)}, + {float(liw.x / frame.size.width), float(liw.y / frame.size.height)} }; booContext->m_callback->mouseMove(coord); } @@ -601,9 +601,9 @@ static inline boo::EMouseButton getButton(NSEvent* event) NSRect frame = [parentView frame]; boo::SWindowCoord coord = { - {(unsigned)(liw.x * pixelFactor), (unsigned)(liw.y * pixelFactor)}, - {(unsigned)liw.x, (unsigned)liw.y}, - {(float)(liw.x / frame.size.width), (float)(liw.y / frame.size.height)} + {int(liw.x * pixelFactor), int(liw.y * pixelFactor)}, + {int(liw.x), int(liw.y)}, + {float(liw.x / frame.size.width), float(liw.y / frame.size.height)} }; boo::SScrollDelta scroll = {