You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
820 B
48 lines
820 B
#pragma once
|
|
|
|
#include "ofRectangle.h"
|
|
#include "ofPolyline.h"
|
|
#include "GuiBaseWidget.h"
|
|
#include "ofGraphics.h"
|
|
#include "BaseSurface.h"
|
|
|
|
namespace ofx {
|
|
namespace piMapper {
|
|
|
|
class ScaleWidget : public GuiBaseWidget {
|
|
public:
|
|
ScaleWidget();
|
|
|
|
void setup();
|
|
void update();
|
|
void draw();
|
|
|
|
void onMousePressed(ofMouseEventArgs & args);
|
|
void onMouseReleased(ofMouseEventArgs & args);
|
|
void onMouseDragged(ofMouseEventArgs & args);
|
|
|
|
bool inside(float x, float y);
|
|
|
|
// This should be the size of the objet's bounding box
|
|
void setSurface(BaseSurface * s);
|
|
|
|
float getScale(){
|
|
return _scale;
|
|
}
|
|
|
|
private:
|
|
ofRectangle _handle;
|
|
|
|
ofPolyline _line;
|
|
|
|
float _scale;
|
|
|
|
bool _dragging;
|
|
|
|
BaseSurface * _surface;
|
|
|
|
void setRect(ofRectangle rect);
|
|
};
|
|
|
|
} // namespace piMapper
|
|
} // namespace ofx
|