From b47ba5bcd0ab676a05d5556ead2770106b34722c Mon Sep 17 00:00:00 2001 From: Igor Zinken Date: Sun, 16 Apr 2023 10:58:09 +0200 Subject: [PATCH] Allow drawing operations on scaled layers (#29) Allow drawing operations on scaled layers --- README.md | 67 +++++++++---------- .../tool-options-scale/messages.json | 3 +- .../tool-options-scale/tool-options-scale.vue | 3 +- src/definitions/tool-types.ts | 4 +- src/rendering/canvas-elements/layer-sprite.ts | 8 ++- src/utils/selection-util.ts | 8 ++- src/utils/shape-util.ts | 6 +- tests/unit/utils/selection-util.spec.ts | 46 +++++++++---- tests/unit/utils/shape-util.spec.ts | 17 ++++- 9 files changed, 102 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 005b223..b99aa4d 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,18 @@ No, I'm building a tool that does the bare minimum what I require and what I don find in other open source tools. That doesn't mean of course that contributions related to Photoshop-esque features aren't welcomed. -## The [Issue Tracker](https://github.com/igorski/bitmappery/issues) is your point of contact - -Bug reports, feature requests, questions and discussions are welcome on the GitHub Issue Tracker, please do not send e-mails through the development website. However, please search before posting to avoid duplicates, and limit to one issue per post. - -Please vote on feature requests by using the Thumbs Up/Down reaction on the first post. - ### All hand-written ? Yep, though it helps having worked in the photo software industry for five years, having tackled the problems before. Also, BitMappery is reusing [zCanvas](https://github.com/igorski/zCanvas) under the hood for rendering and bitmap blitting. BitMappery is written on top of [Vue](https://github.com/vuejs/vue) using [Vuex](https://github.com/vuejs/vuex) and [VueI18n](https://github.com/kazupon/vue-i18n). +## The [Issue Tracker](https://github.com/igorski/bitmappery/issues) is your point of contact + +Bug reports, feature requests, questions and discussions are welcome on the GitHub Issue Tracker, please do not send e-mails through the development website. However, please search before posting to avoid duplicates, and limit to one issue per post. + +Please vote on feature requests by using the Thumbs Up/Down reaction on the first post. + ## Model BitMappery works with entities known as _Documents_. A Document contains several _Layers_, each of @@ -113,9 +113,10 @@ Whenever an action (that requires an undo state) can be triggered in multiple lo inside a component and as a keyboard shortcut in `@/src/services/keyboard-service`), you can create a custom handler inside `@/src/factories/action-factory` to avoid code duplication. -## Dropbox integration +## Third party storage integration -Requires you to [register a client id or access token](https://www.dropbox.com/developers/apps). +Requires you to register a client id or access token in the developer portal of the third party +storage provider. Currently, there is support for [Dropbox](https://www.dropbox.com/developers/apps) and [Google Drive](https://console.cloud.google.com/). ## Project setup @@ -134,7 +135,29 @@ after which you can run: The above will suffice when working solely on the JavaScript side of things. -### WebAssembly +## Docker based self hosted version + +#### Step 1 : Clone the BitMappery project into a local folder : + +```bash +git clone https://github.com/igorski/bitmappery.git +``` + +#### Step 2 : Build the image using the provided Dockerfile : + +```bash +docker build -t bitmappery . +``` + +#### Step 3 : Once the image is built, run the container and bind the ports : + +```bash +docker run -d -p 5173:5173 --name bitmappery-container bitmappery +``` + +Once the container is started, you can access BitMappery at `http://localhost:5173` + +## WebAssembly BitMappery can also use WebAssembly to increase performance of image manipulation. The source code is C based and compiled to WASM using [Emscripten](https://github.com/emscripten-core/emscripten). Because this setup is a little more cumbersome, the repository contains precompiled binaries @@ -158,31 +181,7 @@ now you can compile all source files to WASM using: npm run wasm ``` - -## Docker - -### Step 1 : Go into a folder on your local machine and git clone the BitMappery project : - -```bash -git clone https://github.com/igorski/bitmappery.git -``` - - -### Step 2 : Build the image using the dockerfile provided : -```bash -docker build -t bitmappery . -``` -### Step 3 : Once the image is built, run the container and bind the ports : - -```bash -docker run -d -p 5173:5173 --name bitmappery-container bitmappery -``` - -### Step 4 : Once the container is started, you should be able to reach `http://localhost:5173` - - - -## Benchmarks +### Benchmarks On a particular (low powered) configuration, running all filters on a particular source takes: diff --git a/src/components/tool-options-panel/tool-options-scale/messages.json b/src/components/tool-options-panel/tool-options-scale/messages.json index 7b4afc4..9eb00d9 100644 --- a/src/components/tool-options-panel/tool-options-scale/messages.json +++ b/src/components/tool-options-panel/tool-options-scale/messages.json @@ -2,7 +2,6 @@ "en-US": { "scale": "Scale", "reset": "Reset", - "save": "Save", - "drawingDisabledUntilSaved": "Scaled layers are not drawable until the scale is made permanent." + "save": "Save" } } diff --git a/src/components/tool-options-panel/tool-options-scale/tool-options-scale.vue b/src/components/tool-options-panel/tool-options-scale/tool-options-scale.vue index 38e5959..04c97d1 100644 --- a/src/components/tool-options-panel/tool-options-scale/tool-options-scale.vue +++ b/src/components/tool-options-panel/tool-options-scale/tool-options-scale.vue @@ -1,7 +1,7 @@ /** * The MIT License (MIT) * - * Igor Zinken 2021-2022 - https://www.igorski.nl + * Igor Zinken 2021-2023 - https://www.igorski.nl * * 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 @@ -23,7 +23,6 @@