Permalink
Browse files

fixing deletion bug… and making a bigger rectangle area to focus patches

  • Loading branch information...
1 parent 06e989b commit 06645e6bd31203098493225c90d241945c12cc96 @patriciogonzalezvivo committed Apr 28, 2012
Showing with 19 additions and 6 deletions.
  1. +9 −0 license.md
  2. +3 −5 src/ofxComposer.cpp
  3. +6 −0 src/ofxPatch.cpp
  4. +1 −1 src/ofxPatch.h
View
@@ -0,0 +1,9 @@
+The code in this repository is available under the [MIT License](https://secure.wikimedia.org/wikipedia/en/wiki/Mit_license).
+
+Copyright (c) 2012- [Patricio Gonzalez Vivo](http://www.patriciogonzalezvivo.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -163,13 +163,11 @@ void ofxComposer::closePatch( int &_nID ){
}
}
- selectedID = -1;
-
// Delete object from memory and then from vector
//
- ofxPatch * tmp = patches[_nID];
- cout << patches.erase(_nID) << endl;
- delete tmp;
+ selectedID = -1;
+ delete &patches[_nID];
+ patches.erase(_nID);
// Delete XML Data
//
View
@@ -166,6 +166,12 @@ ofTexture& ofxPatch::getTextureReference(){
return getSrcTexture();
}
+bool ofxPatch::isOver(ofPoint _pos){
+ ofRectangle biggerBox = textureCorners.getBoundingBox();
+ biggerBox.setFromCenter(biggerBox.getCenter().x, biggerBox.getCenter().y, biggerBox.width*1.2, biggerBox.height*1.2);
+ return textureCorners.inside(_pos);
+};
+
//---------------------------------------------------------------------- LOOPS
void ofxPatch::update(){
if ((width != getSrcTexture().getWidth()) ||
View
@@ -67,7 +67,7 @@ class ofxPatch{
void update();
void draw();
- bool isOver(ofPoint _pos){ return textureCorners.inside(_pos); };
+ bool isOver(ofPoint _pos);//{ return textureCorners.inside(_pos); };
vector<LinkDot> outPut;
vector<LinkDot> inPut;

0 comments on commit 06645e6

Please sign in to comment.