@@ -243,7 +243,7 @@ const File File::getSpecialLocation (const SpecialLocationType type) | |||
{ | |||
const ScopedAutoReleasePool pool; | |||
const char* resultPath = 0; | |||
String resultPath; | |||
switch (type) | |||
{ | |||
@@ -182,9 +182,28 @@ public: | |||
[menu removeItem: item]; | |||
} | |||
static NSMenuItem* findMenuItem (NSMenu* const menu, const ApplicationCommandTarget::InvocationInfo& info) | |||
{ | |||
for (int i = [menu numberOfItems]; --i >= 0;) | |||
{ | |||
NSMenuItem* m = [menu itemAtIndex: i]; | |||
if ([m tag] == info.commandID) | |||
return m; | |||
if ([m submenu] != 0) | |||
{ | |||
NSMenuItem* found = findMenuItem ([m submenu], info); | |||
if (found != 0) | |||
return found; | |||
} | |||
} | |||
return 0; | |||
} | |||
void menuCommandInvoked (MenuBarModel*, const ApplicationCommandTarget::InvocationInfo& info) | |||
{ | |||
NSMenuItem* item = [[NSApp mainMenu] itemWithTag: info.commandID]; | |||
NSMenuItem* item = findMenuItem ([NSApp mainMenu], info); | |||
if (item != 0) | |||
flashMenuBar ([item menu]); | |||
@@ -234,7 +253,6 @@ public: | |||
keyEquivalent: @""]; | |||
[item setEnabled: false]; | |||
[item setIndentationLevel: 5]; | |||
} | |||
else if (iter.subMenu != 0) | |||
{ | |||
@@ -247,7 +265,6 @@ public: | |||
NSMenu* sub = createMenu (*iter.subMenu, iter.itemName, topLevelMenuId, topLevelIndex); | |||
[menuToAddTo setSubmenu: sub forItem: item]; | |||
[sub release]; | |||
} | |||
else | |||
{ | |||
@@ -821,13 +821,7 @@ void NSViewComponentPeer::setBounds (int x, int y, int w, int h, const bool isNo | |||
{ | |||
r.origin.y = [[[NSScreen screens] objectAtIndex: 0] frame].size.height - (r.origin.y + r.size.height); | |||
const BorderSize border (getFrameSize()); | |||
r.origin.x -= border.getLeft(); | |||
r.origin.y -= border.getTop(); | |||
r.size.width += border.getLeftAndRight(); | |||
r.size.height += border.getTopAndBottom(); | |||
[window setFrame: r | |||
[window setFrame: [window frameRectForContentRect: r] | |||
display: true]; | |||
} | |||
} | |||
@@ -1,7 +1,7 @@ | |||
<?xml version="1.0" encoding="Windows-1252"?> | |||
<VisualStudioProject | |||
ProjectType="Visual C++" | |||
Version="9.00" | |||
Version="8.00" | |||
Name="JUCE" | |||
ProjectGUID="{AE232C11-D91C-4CA1-B24E-8B11A52EFF26}" | |||
RootNamespace="JUCE" | |||
@@ -76519,7 +76519,14 @@ void Graphics::drawImageTransformed (const Image* const imageToDraw, | |||
&& (! context->isClipEmpty()) | |||
&& ! transform.isSingularity()) | |||
{ | |||
if (fillAlphaChannelWithCurrentBrush) | |||
if (transform.isIdentity()) | |||
{ | |||
drawImage (imageToDraw, | |||
sourceClipX, sourceClipY, sourceClipWidth, sourceClipHeight, | |||
sourceClipX, sourceClipY, sourceClipWidth, sourceClipHeight, | |||
fillAlphaChannelWithCurrentBrush); | |||
} | |||
else if (fillAlphaChannelWithCurrentBrush) | |||
{ | |||
Path p; | |||
p.addRectangle ((float) sourceClipX, (float) sourceClipY, | |||
@@ -85391,15 +85398,13 @@ const AffineTransform Path::getTransformToScaleToFit (const float x, const float | |||
} | |||
} | |||
static const float collisionDetectionTolerence = 20.0f; | |||
bool Path::contains (const float x, const float y) const throw() | |||
bool Path::contains (const float x, const float y, const float tolerence) const throw() | |||
{ | |||
if (x <= pathXMin || x >= pathXMax | |||
|| y <= pathYMin || y >= pathYMax) | |||
return false; | |||
PathFlatteningIterator i (*this, AffineTransform::identity, collisionDetectionTolerence); | |||
PathFlatteningIterator i (*this, AffineTransform::identity, tolerence); | |||
int positiveCrossings = 0; | |||
int negativeCrossings = 0; | |||
@@ -85426,9 +85431,10 @@ bool Path::contains (const float x, const float y) const throw() | |||
} | |||
bool Path::intersectsLine (const float x1, const float y1, | |||
const float x2, const float y2) throw() | |||
const float x2, const float y2, | |||
const float tolerence) throw() | |||
{ | |||
PathFlatteningIterator i (*this, AffineTransform::identity, collisionDetectionTolerence); | |||
PathFlatteningIterator i (*this, AffineTransform::identity, tolerence); | |||
const Line line1 (x1, y1, x2, y2); | |||
@@ -265243,7 +265249,7 @@ const File File::getSpecialLocation (const SpecialLocationType type) | |||
{ | |||
const ScopedAutoReleasePool pool; | |||
const char* resultPath = 0; | |||
String resultPath; | |||
switch (type) | |||
{ | |||
@@ -266631,13 +266637,7 @@ void NSViewComponentPeer::setBounds (int x, int y, int w, int h, const bool isNo | |||
{ | |||
r.origin.y = [[[NSScreen screens] objectAtIndex: 0] frame].size.height - (r.origin.y + r.size.height); | |||
const BorderSize border (getFrameSize()); | |||
r.origin.x -= border.getLeft(); | |||
r.origin.y -= border.getTop(); | |||
r.size.width += border.getLeftAndRight(); | |||
r.size.height += border.getTopAndBottom(); | |||
[window setFrame: r | |||
[window setFrame: [window frameRectForContentRect: r] | |||
display: true]; | |||
} | |||
} | |||
@@ -268177,9 +268177,28 @@ public: | |||
[menu removeItem: item]; | |||
} | |||
static NSMenuItem* findMenuItem (NSMenu* const menu, const ApplicationCommandTarget::InvocationInfo& info) | |||
{ | |||
for (int i = [menu numberOfItems]; --i >= 0;) | |||
{ | |||
NSMenuItem* m = [menu itemAtIndex: i]; | |||
if ([m tag] == info.commandID) | |||
return m; | |||
if ([m submenu] != 0) | |||
{ | |||
NSMenuItem* found = findMenuItem ([m submenu], info); | |||
if (found != 0) | |||
return found; | |||
} | |||
} | |||
return 0; | |||
} | |||
void menuCommandInvoked (MenuBarModel*, const ApplicationCommandTarget::InvocationInfo& info) | |||
{ | |||
NSMenuItem* item = [[NSApp mainMenu] itemWithTag: info.commandID]; | |||
NSMenuItem* item = findMenuItem ([NSApp mainMenu], info); | |||
if (item != 0) | |||
flashMenuBar ([item menu]); | |||
@@ -268229,7 +268248,6 @@ public: | |||
keyEquivalent: @""]; | |||
[item setEnabled: false]; | |||
[item setIndentationLevel: 5]; | |||
} | |||
else if (iter.subMenu != 0) | |||
{ | |||
@@ -268242,7 +268260,6 @@ public: | |||
NSMenu* sub = createMenu (*iter.subMenu, iter.itemName, topLevelMenuId, topLevelIndex); | |||
[menuToAddTo setSubmenu: sub forItem: item]; | |||
[sub release]; | |||
} | |||
else | |||
{ | |||
@@ -16541,19 +16541,29 @@ public: | |||
The path's winding rule is taken into account by this method. | |||
The tolerence parameter is passed to the PathFlatteningIterator that | |||
is used to trace the path - for more info about it, see the notes for | |||
the PathFlatteningIterator constructor. | |||
@see closeSubPath, setUsingNonZeroWinding | |||
*/ | |||
bool contains (const float x, | |||
const float y) const throw(); | |||
const float y, | |||
const float tolerence = 10.0f) const throw(); | |||
/** Checks whether a line crosses the path. | |||
This will return positive if the line crosses any of the paths constituent | |||
lines or curves. It doesn't take into account whether the line is inside | |||
or outside the path, or whether the path is open or closed. | |||
The tolerence parameter is passed to the PathFlatteningIterator that | |||
is used to trace the path - for more info about it, see the notes for | |||
the PathFlatteningIterator constructor. | |||
*/ | |||
bool intersectsLine (const float x1, const float y1, | |||
const float x2, const float y2) throw(); | |||
const float x2, const float y2, | |||
const float tolerence = 10.0f) throw(); | |||
/** Removes all lines and curves, resetting the path completely. */ | |||
void clear() throw(); | |||
@@ -917,7 +917,14 @@ void Graphics::drawImageTransformed (const Image* const imageToDraw, | |||
&& (! context->isClipEmpty()) | |||
&& ! transform.isSingularity()) | |||
{ | |||
if (fillAlphaChannelWithCurrentBrush) | |||
if (transform.isIdentity()) | |||
{ | |||
drawImage (imageToDraw, | |||
sourceClipX, sourceClipY, sourceClipWidth, sourceClipHeight, | |||
sourceClipX, sourceClipY, sourceClipWidth, sourceClipHeight, | |||
fillAlphaChannelWithCurrentBrush); | |||
} | |||
else if (fillAlphaChannelWithCurrentBrush) | |||
{ | |||
Path p; | |||
p.addRectangle ((float) sourceClipX, (float) sourceClipY, | |||
@@ -999,15 +999,13 @@ const AffineTransform Path::getTransformToScaleToFit (const float x, const float | |||
} | |||
//============================================================================== | |||
static const float collisionDetectionTolerence = 20.0f; | |||
bool Path::contains (const float x, const float y) const throw() | |||
bool Path::contains (const float x, const float y, const float tolerence) const throw() | |||
{ | |||
if (x <= pathXMin || x >= pathXMax | |||
|| y <= pathYMin || y >= pathYMax) | |||
return false; | |||
PathFlatteningIterator i (*this, AffineTransform::identity, collisionDetectionTolerence); | |||
PathFlatteningIterator i (*this, AffineTransform::identity, tolerence); | |||
int positiveCrossings = 0; | |||
int negativeCrossings = 0; | |||
@@ -1034,9 +1032,10 @@ bool Path::contains (const float x, const float y) const throw() | |||
} | |||
bool Path::intersectsLine (const float x1, const float y1, | |||
const float x2, const float y2) throw() | |||
const float x2, const float y2, | |||
const float tolerence) throw() | |||
{ | |||
PathFlatteningIterator i (*this, AffineTransform::identity, collisionDetectionTolerence); | |||
PathFlatteningIterator i (*this, AffineTransform::identity, tolerence); | |||
const Line line1 (x1, y1, x2, y2); | |||
@@ -112,19 +112,29 @@ public: | |||
The path's winding rule is taken into account by this method. | |||
The tolerence parameter is passed to the PathFlatteningIterator that | |||
is used to trace the path - for more info about it, see the notes for | |||
the PathFlatteningIterator constructor. | |||
@see closeSubPath, setUsingNonZeroWinding | |||
*/ | |||
bool contains (const float x, | |||
const float y) const throw(); | |||
const float y, | |||
const float tolerence = 10.0f) const throw(); | |||
/** Checks whether a line crosses the path. | |||
This will return positive if the line crosses any of the paths constituent | |||
lines or curves. It doesn't take into account whether the line is inside | |||
or outside the path, or whether the path is open or closed. | |||
The tolerence parameter is passed to the PathFlatteningIterator that | |||
is used to trace the path - for more info about it, see the notes for | |||
the PathFlatteningIterator constructor. | |||
*/ | |||
bool intersectsLine (const float x1, const float y1, | |||
const float x2, const float y2) throw(); | |||
const float x2, const float y2, | |||
const float tolerence = 10.0f) throw(); | |||
//============================================================================== | |||
/** Removes all lines and curves, resetting the path completely. */ | |||