| @@ -520,8 +520,24 @@ public: | |||||
| virtual void doExtraInitialisation() {} | virtual void doExtraInitialisation() {} | ||||
| virtual void addExtraConfigItems (Project&, TreeViewItem&) {} | virtual void addExtraConfigItems (Project&, TreeViewItem&) {} | ||||
| virtual String getLogFolderName() const { return "com.juce.introjucer"; } | virtual String getLogFolderName() const { return "com.juce.introjucer"; } | ||||
| virtual PropertiesFile::Options getPropertyFileOptionsFor (const String& filename) | |||||
| { | |||||
| PropertiesFile::Options options; | |||||
| options.applicationName = filename; | |||||
| options.filenameSuffix = "settings"; | |||||
| options.osxLibrarySubFolder = "Application Support"; | |||||
| #if JUCE_LINUX | |||||
| options.folderName = ".introjucer"; | |||||
| #else | |||||
| options.folderName = "Introjucer"; | |||||
| #endif | |||||
| return options; | |||||
| } | |||||
| virtual Component* createProjectContentComponent() const | virtual Component* createProjectContentComponent() const | ||||
| { | { | ||||
| return new ProjectContentComponent(); | return new ProjectContentComponent(); | ||||
| @@ -49,8 +49,7 @@ public: | |||||
| void setScaleFactor (double newScale) | void setScaleFactor (double newScale) | ||||
| { | { | ||||
| scaleFactor = newScale; | scaleFactor = newScale; | ||||
| content->setTransform (AffineTransform::scale ((float) scaleFactor, | |||||
| (float) scaleFactor)); | |||||
| content->setTransform (AffineTransform::scale ((float) scaleFactor)); | |||||
| } | } | ||||
| private: | private: | ||||
| @@ -70,14 +69,14 @@ public: | |||||
| void mouseWheelMove (const MouseEvent& e, const MouseWheelDetails& wheel) | void mouseWheelMove (const MouseEvent& e, const MouseWheelDetails& wheel) | ||||
| { | { | ||||
| if (e.mods.isCtrlDown() || e.mods.isAltDown() || e.mods.isCommandDown()) | if (e.mods.isCtrlDown() || e.mods.isAltDown() || e.mods.isCommandDown()) | ||||
| { | |||||
| const double factor = 1.0f / (1.0f - wheel.deltaY); | |||||
| panel->setZoom (panel->getZoom() * factor, e.x, e.y); | |||||
| } | |||||
| mouseMagnify (e, 1.0f / (1.0f - wheel.deltaY)); | |||||
| else | else | ||||
| { | |||||
| Viewport::mouseWheelMove (e, wheel); | Viewport::mouseWheelMove (e, wheel); | ||||
| } | |||||
| } | |||||
| void mouseMagnify (const MouseEvent& e, float factor) | |||||
| { | |||||
| panel->setZoom (panel->getZoom() * factor, e.x, e.y); | |||||
| } | } | ||||
| void dragKeyHeldDown (const bool isKeyDown) | void dragKeyHeldDown (const bool isKeyDown) | ||||
| @@ -181,7 +181,6 @@ void PaintRoutineEditor::refreshAllElements() | |||||
| if (currentBackgroundColour != graphics.getBackgroundColour()) | if (currentBackgroundColour != graphics.getBackgroundColour()) | ||||
| { | { | ||||
| currentBackgroundColour = graphics.getBackgroundColour(); | currentBackgroundColour = graphics.getBackgroundColour(); | ||||
| grid.updateColour(); | |||||
| repaint(); | repaint(); | ||||
| } | } | ||||
| @@ -241,7 +240,7 @@ void PaintRoutineEditor::findLassoItemsInArea (Array <PaintElement*>& results, c | |||||
| { | { | ||||
| for (int i = 0; i < getNumChildComponents(); ++i) | for (int i = 0; i < getNumChildComponents(); ++i) | ||||
| if (PaintElement* const e = dynamic_cast <PaintElement*> (getChildComponent (i))) | if (PaintElement* const e = dynamic_cast <PaintElement*> (getChildComponent (i))) | ||||
| if (e->getBounds().expanded (-e->borderThickness, -e->borderThickness).intersects (lasso)) | |||||
| if (e->getBounds().expanded (-e->borderThickness).intersects (lasso)) | |||||
| results.add (e); | results.add (e); | ||||
| } | } | ||||
| @@ -46,50 +46,36 @@ public: | |||||
| { | { | ||||
| snapGridSize = design.getSnappingGridSize(); | snapGridSize = design.getSnappingGridSize(); | ||||
| snapShown = design.isSnapShown() && design.isSnapActive (false); | snapShown = design.isSnapShown() && design.isSnapActive (false); | ||||
| backgroundFill = Image(); | |||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| void updateColour() | |||||
| { | |||||
| backgroundFill = Image(); | |||||
| } | |||||
| void draw (Graphics& g, PaintRoutine* backgroundGraphics) | void draw (Graphics& g, PaintRoutine* backgroundGraphics) | ||||
| { | { | ||||
| if (backgroundFill.isNull() && snapShown) | |||||
| if (snapShown && snapGridSize > 2) | |||||
| { | { | ||||
| backgroundFill = Image (Image::ARGB, snapGridSize, snapGridSize, true); | |||||
| Graphics g2 (backgroundFill); | |||||
| Colour col (Colours::black); | Colour col (Colours::black); | ||||
| if (backgroundGraphics != nullptr) | if (backgroundGraphics != nullptr) | ||||
| col = backgroundGraphics->getBackgroundColour().contrasting(); | col = backgroundGraphics->getBackgroundColour().contrasting(); | ||||
| if (snapGridSize > 2) | |||||
| { | |||||
| g2.setColour (col.withAlpha (0.1f)); | |||||
| g2.drawRect (0, 0, snapGridSize + 1, snapGridSize + 1); | |||||
| } | |||||
| } | |||||
| g.setColour (col.withAlpha (0.1f)); | |||||
| if (backgroundFill.isValid()) | |||||
| { | |||||
| g.setTiledImageFill (backgroundFill, 0, 0, 1.0f); | |||||
| g.fillAll(); | |||||
| const Rectangle<int> clip (g.getClipBounds()); | |||||
| for (int y = clip.getY() - (clip.getY() % snapGridSize); y < clip.getBottom(); y += snapGridSize) | |||||
| g.drawHorizontalLine (y, 0.0f, (float) clip.getRight()); | |||||
| for (int x = clip.getX() - (clip.getX() % snapGridSize); x < clip.getRight(); x += snapGridSize) | |||||
| g.drawVerticalLine (x, 0.0f, (float) clip.getBottom()); | |||||
| } | } | ||||
| } | } | ||||
| private: | private: | ||||
| int snapGridSize; | int snapGridSize; | ||||
| bool snapShown; | bool snapShown; | ||||
| Image backgroundFill; | |||||
| }; | }; | ||||
| @@ -57,17 +57,8 @@ PropertiesFile& StoredSettings::getGlobalProperties() | |||||
| static PropertiesFile* createPropsFile (const String& filename) | static PropertiesFile* createPropsFile (const String& filename) | ||||
| { | { | ||||
| PropertiesFile::Options options; | |||||
| options.applicationName = filename; | |||||
| options.filenameSuffix = "settings"; | |||||
| options.osxLibrarySubFolder = "Application Support"; | |||||
| #if JUCE_LINUX | |||||
| options.folderName = ".introjucer"; | |||||
| #else | |||||
| options.folderName = "Introjucer"; | |||||
| #endif | |||||
| return new PropertiesFile (options); | |||||
| return new PropertiesFile (IntrojucerApp::getApp() | |||||
| .getPropertyFileOptionsFor (filename)); | |||||
| } | } | ||||
| PropertiesFile& StoredSettings::getProjectProperties (const String& projectUID) | PropertiesFile& StoredSettings::getProjectProperties (const String& projectUID) | ||||