projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replaced SetSizeHints -> SetMinSize
[wxWidgets.git]
/
src
/
mac
/
carbon
/
dccg.cpp
diff --git
a/src/mac/carbon/dccg.cpp
b/src/mac/carbon/dccg.cpp
index 01514f90f2048112d38b9ba761af2a45c2213767..2d2f2e27a4b31b852872c02a0b677caeec0c1636 100755
(executable)
--- a/
src/mac/carbon/dccg.cpp
+++ b/
src/mac/carbon/dccg.cpp
@@
-2286,70
+2286,42
@@
void wxDC::Clear(void)
*/ // TODO
wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
{
*/ // TODO
wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
{
- long new_x = x - m_deviceOriginX;
- if (new_x > 0)
- return (wxCoord)((double)new_x / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
- else
- return (wxCoord)((double)new_x / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
+ return wxCoordRound((double)(x - m_deviceOriginX) / m_scaleX) * m_signX + m_logicalOriginX;
}
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
{
}
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
{
- long new_y = y - m_deviceOriginY;
- if (new_y > 0)
- return (wxCoord)((double)new_y / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
- else
- return (wxCoord)((double)new_y / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
+ return wxCoordRound((double)(y - m_deviceOriginY) / m_scaleY) * m_signY + m_logicalOriginY;
}
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
{
}
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
{
- if (x > 0)
- return (wxCoord)((double)x / m_scaleX + 0.5);
- else
- return (wxCoord)((double)x / m_scaleX - 0.5);
+ return wxCoordRound((double)(x) / m_scaleX);
}
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
{
}
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
{
- if (y > 0)
- return (wxCoord)((double)y / m_scaleY + 0.5);
- else
- return (wxCoord)((double)y / m_scaleY - 0.5);
+ return wxCoordRound((double)(y) / m_scaleY);
}
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
{
}
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
{
- long new_x = x - m_logicalOriginX;
- if (new_x > 0)
- return (wxCoord)((double)new_x * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
- else
- return (wxCoord)((double)new_x * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
+ return wxCoordRound((double)(x - m_logicalOriginX) * m_scaleX) * m_signX + m_deviceOriginX;
}
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
{
}
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
{
- long new_y = y - m_logicalOriginY;
- if (new_y > 0)
- return (wxCoord)((double)new_y * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
- else
- return (wxCoord)((double)new_y * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
+ return wxCoordRound((double)(y - m_logicalOriginY) * m_scaleY) * m_signY + m_deviceOriginY;
}
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
{
}
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
{
- if (x > 0)
- return (wxCoord)((double)x * m_scaleX + 0.5);
- else
- return (wxCoord)((double)x * m_scaleX - 0.5);
+ return wxCoordRound((double)(x) * m_scaleX);
}
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
{
}
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
{
- if (y > 0)
- return (wxCoord)((double)y * m_scaleY + 0.5);
- else
- return (wxCoord)((double)y * m_scaleY - 0.5);
+ return wxCoordRound((double)(y) * m_scaleY);
}
#endif // wxMAC_USE_CORE_GRAPHICS
}
#endif // wxMAC_USE_CORE_GRAPHICS