Disable Shift+click to draw straight lines when we are in SelectBoxState

This commit is contained in:
David Capello 2019-04-29 15:50:34 -03:00
parent 23ea6a392e
commit c7955337c2
3 changed files with 8 additions and 3 deletions

View File

@ -104,6 +104,9 @@ namespace app {
virtual void postRenderDecorator(EditorPostRender* render) override;
virtual void getInvalidDecoratoredRegion(Editor* editor, gfx::Region& region) override;
// Disable Shift+click to draw straight lines with the Pencil tool
virtual bool canCheckStartDrawingStraightLine() { return false; }
private:
typedef std::vector<Ruler> Rulers;

View File

@ -639,7 +639,8 @@ bool StandbyState::checkStartDrawingStraightLine(Editor* editor,
const ui::MouseMessage* msg)
{
// Start line preview with shift key
if (editor->startStraightLineWithFreehandTool(msg)) {
if (canCheckStartDrawingStraightLine() &&
editor->startStraightLineWithFreehandTool(msg)) {
tools::Pointer::Button pointerButton =
(msg ? button_from_msg(msg): tools::Pointer::Left);

View File

@ -48,12 +48,13 @@ namespace app {
virtual Transformation getTransformation(Editor* editor);
void startSelectionTransformation(Editor* editor, const gfx::Point& move, double angle);
void startFlipTransformation(Editor* editor, doc::algorithm::FlipType flipType);
protected:
void callEyedropper(Editor* editor, const ui::MouseMessage* msg);
bool checkStartDrawingStraightLine(Editor* editor, const ui::MouseMessage* msg);
virtual bool canCheckStartDrawingStraightLine() { return true; }
class Decorator : public EditorDecorator {
public: