Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CompileFlags:
Add:
- -std=c++23
- -Wall
2 changes: 1 addition & 1 deletion LICENSE_HEADER
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (C) 2025 - Prayag Jain <[email protected]>
*
* Authors:
* 1. <name> - <email>
* 1. <name> <<email>>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
87 changes: 51 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
Drawy is a work-in-progress infinite whiteboard tool written in Qt/C++, which aims to be a native-desktop alternative to the amazing web-based Excalidraw.

# Community
Join our Discord server to engage with our community and help shape the future of Drawy!

<a href="https://discord.gg/TUPwH24j"><img alt="Static Badge" src="https://img.shields.io/badge/Discord%20-%20Server?style=for-the-badge&logo=Discord&color=%23eee"></a>

# Installation
Join our Discord server to engage with our community and help shape the future of Drawy!

<a href="https://discord.gg/TUPwH24j"><img alt="Static Badge" src="https://img.shields.io/badge/Discord%20-%20Server?style=for-the-badge&logo=Discord&color=%23eee"></a>

# Installation

<a href="https://github.com/Prayag2/drawy/releases/download/1.0.0-alpha/Drawy-47b7552-x86_64.AppImage">
<img alt="Static Badge" src="https://img.shields.io/badge/Download-Linux-F7B601?style=for-the-badge&labelColor=%23202025">
</a>
Expand All @@ -29,6 +31,7 @@ Join our Discord server to engage with our community and help shape the future o
</a>

## Compiling from Source

- Install `cmake` and `g++`
- Install Qt 6.9 or above from [here](https://www.qt.io/download-qt-installer-oss) or using [aqtinstall](https://github.com/miurahr/aqtinstall)
- Clone this repository: `git clone https://github.com/prayag2/drawy && cd drawy`
Expand All @@ -37,64 +40,76 @@ Join our Discord server to engage with our community and help shape the future o
- Run: `./build/drawy`

# Keyboard Shortcuts
Future releases will allow you to change the keyboard shortcuts. For now they are hardcoded. Here's a list of all available keyboard shortcuts:
| Key Combination | Description |
|:---------------------------------------------------------------------------:|:-----------------:|
| <kbd>Ctrl</kbd> + <kbd>Z</kbd> | Undo |
| <kbd>Ctrl</kbd> + <kbd>Y</kbd>, <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Z</kbd> | Redo |
| <kbd>Ctrl</kbd> + <kbd>+</kbd> | Zoom In |
| <kbd>Ctrl</kbd> + <kbd>-</kbd> | Zoom Out |
| <kbd>Ctrl</kbd> + <kbd>G</kbd> | Group selection |
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>G</kbd> | Ungroup selection |
| <kbd>P</kbd>, <kbd>B</kbd> | Freeform Tool |
| <kbd>E</kbd> | Eraser Tool |
| <kbd>S</kbd> | Selection Tool |
| <kbd>R</kbd> | Rectangle Tool |
| <kbd>O</kbd> | Ellipse Tool |
| <kbd>L</kbd> | Line Tool |
| <kbd>A</kbd> | Arrow Tool |
| <kbd>M</kbd> | Move Tool |
| <kbd>T</kbd> | Text Tool |
| <kbd>Ctrl+A</kbd> | Select All |
| <kbd>Delete</kbd> | Delete selection |
| <kbd>Ctrl+S</kbd> | Save |
| <kbd>Ctrl+O</kbd> | Open File |

> [!NOTE]
> Future releases will allow you to change the keyboard shortcuts.

| Key Combination | Description |
|:---------------------------------------------------------------------------------:|:--------------------------:|
| <kbd>Ctrl</kbd> + <kbd>Z</kbd> | Undo |
| <kbd>Ctrl</kbd> + <kbd>Y</kbd>, <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Z</kbd> | Redo |
| <kbd>Ctrl</kbd> + <kbd>+</kbd> | Zoom In |
| <kbd>Ctrl</kbd> + <kbd>-</kbd> | Zoom Out |
| <kbd>Ctrl</kbd> + <kbd>G</kbd> | Group selection |
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>G</kbd> | Ungroup selection |
| <kbd>P</kbd>, <kbd>B</kbd> | Freeform Tool |
| <kbd>E</kbd> | Eraser Tool |
| <kbd>S</kbd> | Selection Tool |
| <kbd>R</kbd> | Rectangle Tool |
| <kbd>O</kbd> | Ellipse Tool |
| <kbd>L</kbd> | Line Tool |
| <kbd>A</kbd> | Arrow Tool |
| <kbd>M</kbd> | Move Tool |
| <kbd>T</kbd> | Text Tool |
| <kbd>Ctrl+A</kbd> | Select All |
| <kbd>Delete</kbd> | Delete selection |
| <kbd>Ctrl+S</kbd> | Save |
| <kbd>Ctrl+O</kbd> | Open File |
| <kbd>Right Click</kbd> (Hold) | Eraser Tool |
| <kbd>Space</kbd> + <kbd>Left Click</kbd> | Move Tool |

# Contributing
Contributions are welcome. Please read the [contributing guide](CONTRIBUTING.md) before opening pull requests.

Contributions are welcome. Please read the [Contributing Guide](CONTRIBUTING.md) before opening pull requests.

# License

This project uses the GNU General Public License V3.

# Support Me ♥
If you liked this project, then please consider supporting me!


If you liked this project, then please consider supporting me!

<a href="https://liberapay.com/Prayag/donate"><img alt="Donate using Liberapay" src="https://img.shields.io/badge/LIBERAPAY-%231A171B?style=for-the-badge&logo=liberapay"/></a>
<a href="https://ko-fi.com/O5O1FJ70D"><img alt="Buy Me A Coffee" src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-%234D798C?style=for-the-badge&logo=ko-fi"/></a>
<a href="https://coindrop.to/prayagjain"><img alt="Done using PayPal" src="https://img.shields.io/badge/PayPal-%23F2BA37?style=for-the-badge&logo=paypal"/></a>

# TODOs
Started: `2025-01-02 04:40PM`
Development is divided into phases.
The project will eventually be open sourced. However, I will work on the first few phases myself, to maximize learning.
The following is a list of features I'll be planning to add to it:

Started: `2025-01-02 04:40PM`
Development is divided into phases.
The project will eventually be open sourced. However, I will work on the first few phases myself, to maximize learning.
The following is a list of features I'll be planning to add to it:

## Phase 1 (Basic Features)

- [x] A simple fixed size canvas to draw on using a black coloured stroke.
- [x] Different shapes like rectangle, ellipse, arrow, line and stroke.
- [x] An eraser to erase the strokes (deleting the strokes).
- [x] Testing.

## Phase 2

- [x] Refactor to try to adhere to SOLID principles and utilize useful design patterns
- [x] A custom Qt layout for toolbar and properties bar
- [x] Make canvas infinite and add ability to move the viewport
- [x] Use an LRU cache based uniform grid to optimize moving the canvas around (now 100% faster!!)
- [x] A properties bar to change the following properties:
- [x] Colour of strokes
- [x] Stroke width
- [x] Stroke width

## Phase 3

- [x] Buttons to zoom in/out
- [x] Pressure senstivity for drawing tablets
- [x] Selection tool to select items and do these actions:
Expand All @@ -112,7 +127,7 @@ The following is a list of features I'll be planning to add to it:
- [ ] Better freeform smoothing algorithms
- [ ] Allow snapping
- [ ] Ability to store preferences
- [ ] A "settings" page
- [ ] A "settings" page
- [ ] Better widgets
- [ ] Online collaboration

Expand Down
37 changes: 19 additions & 18 deletions src/command/deselectcommand.cpp
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
/*
* Drawy - A simple brainstorming tool with an infinite canvas
* Copyright (C) 2025 - Prayag Jain <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Drawy - A simple brainstorming tool with an infinite canvas
* Copyright (C) 2025 - Prayag Jain <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "deselectcommand.hpp"

#include "../context/applicationcontext.hpp"
#include "../context/coordinatetransformer.hpp"
#include "../context/selectioncontext.hpp"
#include "../context/spatialcontext.hpp"
#include "../item/item.hpp"
#include "../data-structures/cachegrid.hpp"
#include "../item/item.hpp"

DeselectCommand::DeselectCommand(QVector<std::shared_ptr<Item>> items) : ItemCommand{items} {}
DeselectCommand::DeselectCommand(QVector<std::shared_ptr<Item>> items) : ItemCommand{items} {
}

DeselectCommand::~DeselectCommand() {
}
Expand Down
32 changes: 16 additions & 16 deletions src/command/deselectcommand.hpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
* Drawy - A simple brainstorming tool with an infinite canvas
* Copyright (C) 2025 - Prayag Jain <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Drawy - A simple brainstorming tool with an infinite canvas
* Copyright (C) 2025 - Prayag Jain <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef DESELECTCOMMAND_H
#define DESELECTCOMMAND_H
Expand Down
38 changes: 19 additions & 19 deletions src/command/groupcommand.cpp
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
/*
* Drawy - A simple brainstorming tool with an infinite canvas
* Copyright (C) 2025 - Prayag Jain <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Drawy - A simple brainstorming tool with an infinite canvas
* Copyright (C) 2025 - Prayag Jain <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "groupcommand.hpp"

#include "commandhistory.hpp"
#include "selectcommand.hpp"
#include "deselectcommand.hpp"
#include "../context/applicationcontext.hpp"
#include "../context/coordinatetransformer.hpp"
#include "../context/selectioncontext.hpp"
#include "../context/spatialcontext.hpp"
#include "../data-structures/cachegrid.hpp"
#include "../data-structures/quadtree.hpp"
#include "../item/group.hpp"
#include "commandhistory.hpp"
#include "deselectcommand.hpp"
#include "selectcommand.hpp"

GroupCommand::GroupCommand(QVector<std::shared_ptr<Item>> items) : ItemCommand{items} {
m_group = std::make_shared<GroupItem>();
Expand Down
32 changes: 16 additions & 16 deletions src/command/groupcommand.hpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
* Drawy - A simple brainstorming tool with an infinite canvas
* Copyright (C) 2025 - Prayag Jain <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Drawy - A simple brainstorming tool with an infinite canvas
* Copyright (C) 2025 - Prayag Jain <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef GROUPCOMMAND_H
#define GROUPCOMMAND_H
Expand Down
37 changes: 19 additions & 18 deletions src/command/selectcommand.cpp
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
/*
* Drawy - A simple brainstorming tool with an infinite canvas
* Copyright (C) 2025 - Prayag Jain <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Drawy - A simple brainstorming tool with an infinite canvas
* Copyright (C) 2025 - Prayag Jain <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "selectcommand.hpp"

#include "../context/applicationcontext.hpp"
#include "../context/coordinatetransformer.hpp"
#include "../context/selectioncontext.hpp"
#include "../context/spatialcontext.hpp"
#include "../item/item.hpp"
#include "../data-structures/cachegrid.hpp"
#include "../item/item.hpp"

SelectCommand::SelectCommand(QVector<std::shared_ptr<Item>> items) : ItemCommand{items} {}
SelectCommand::SelectCommand(QVector<std::shared_ptr<Item>> items) : ItemCommand{items} {
}

SelectCommand::~SelectCommand() {
}
Expand Down
Loading
Loading