mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Compare commits
4 Commits
00b976bd2b
...
873db89dfe
Author | SHA1 | Date | |
---|---|---|---|
873db89dfe | |||
376f687c38 | |||
4fd848abf2 | |||
3a68a43e00 |
@ -399,6 +399,11 @@ class ScalingNoteState extends ActiveState {
|
||||
}));
|
||||
this._originalMousePoint = mousePoint;
|
||||
this._originalSize = _getNoteSize(note);
|
||||
this._origin = _getNoteCentroid(this._note);
|
||||
this._scaleDirection = new Point(
|
||||
mousePoint.x > this._origin.x ? 1 : -1,
|
||||
mousePoint.y > this._origin.y ? 1 : -1
|
||||
);
|
||||
}
|
||||
|
||||
evtCanvasKeyDown(e) {
|
||||
@ -417,22 +422,22 @@ class ScalingNoteState extends ActiveState {
|
||||
evtCanvasMouseMove(e) {
|
||||
const mousePoint = this._getPointFromEvent(e);
|
||||
const originalMousePoint = this._originalMousePoint;
|
||||
const origin = this._origin;
|
||||
const originalSize = this._originalSize;
|
||||
const scaleDirection = this._scaleDirection;
|
||||
const scale = new Point(
|
||||
1 +
|
||||
((mousePoint.x - originalMousePoint.x) / originalSize.x) *
|
||||
scaleDirection.x,
|
||||
1 +
|
||||
((mousePoint.y - originalMousePoint.y) / originalSize.y) *
|
||||
scaleDirection.y
|
||||
);
|
||||
for (let i of misc.range(this._note.polygon.length)) {
|
||||
const polygonPoint = this._note.polygon.at(i);
|
||||
const originalPolygonPoint = this._originalPolygon[i];
|
||||
polygonPoint.x =
|
||||
originalMousePoint.x +
|
||||
(originalPolygonPoint.x - originalMousePoint.x) *
|
||||
(1 +
|
||||
(mousePoint.x - originalMousePoint.x) /
|
||||
originalSize.x);
|
||||
polygonPoint.y =
|
||||
originalMousePoint.y +
|
||||
(originalPolygonPoint.y - originalMousePoint.y) *
|
||||
(1 +
|
||||
(mousePoint.y - originalMousePoint.y) /
|
||||
originalSize.y);
|
||||
const point = this._note.polygon.at(i);
|
||||
const originalPoint = this._originalPolygon[i];
|
||||
point.x = origin.x + (originalPoint.x - origin.x) * scale.x;
|
||||
point.y = origin.y + (originalPoint.y - origin.y) * scale.y;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -789,7 +789,7 @@ data.
|
||||
| `fav-time` | alias of `fav-date` |
|
||||
| `feature-date` | featured at given date |
|
||||
| `feature-time` | alias of `feature-time` |
|
||||
| `safety` | having given safety. `<value>` can be either `safe`, `sketchy` (or `questionable`) or `unsafe`. |
|
||||
| `safety` | having given safety. `<value>` can be either `safe`, `sketchy` or `unsafe`. |
|
||||
| `rating` | alias of `safety` |
|
||||
|
||||
**Sort style tokens**
|
||||
|
@ -1,5 +1,5 @@
|
||||
This assumes that you have Docker (version 17.05 or greater)
|
||||
and Docker Compose (version 1.6.0 or greater) already installed.
|
||||
This assumes that you have Docker (version 19.03 or greater)
|
||||
and the Docker Compose CLI (version 1.27.0 or greater) already installed.
|
||||
|
||||
### Prepare things
|
||||
|
||||
@ -38,7 +38,7 @@ and Docker Compose (version 1.6.0 or greater) already installed.
|
||||
|
||||
This pulls the latest containers from docker.io:
|
||||
```console
|
||||
user@host:szuru$ docker-compose pull
|
||||
user@host:szuru$ docker compose pull
|
||||
```
|
||||
|
||||
If you have modified the application's source and would like to manually
|
||||
@ -49,17 +49,17 @@ and Docker Compose (version 1.6.0 or greater) already installed.
|
||||
|
||||
For first run, it is recommended to start the database separately:
|
||||
```console
|
||||
user@host:szuru$ docker-compose up -d sql
|
||||
user@host:szuru$ docker compose up -d sql
|
||||
```
|
||||
|
||||
To start all containers:
|
||||
```console
|
||||
user@host:szuru$ docker-compose up -d
|
||||
user@host:szuru$ docker compose up -d
|
||||
```
|
||||
|
||||
To view/monitor the application logs:
|
||||
```console
|
||||
user@host:szuru$ docker-compose logs -f
|
||||
user@host:szuru$ docker compose logs -f
|
||||
# (CTRL+C to exit)
|
||||
```
|
||||
|
||||
@ -84,13 +84,13 @@ and Docker Compose (version 1.6.0 or greater) already installed.
|
||||
2. Build the containers:
|
||||
|
||||
```console
|
||||
user@host:szuru$ docker-compose build
|
||||
user@host:szuru$ docker compose build
|
||||
```
|
||||
|
||||
That will attempt to build both containers, but you can specify `client`
|
||||
or `server` to make it build only one.
|
||||
|
||||
If `docker-compose build` spits out:
|
||||
If `docker compose build` spits out:
|
||||
|
||||
```
|
||||
ERROR: Service 'server' failed to build: failed to parse platform : "" is an invalid component of "": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument
|
||||
@ -102,7 +102,7 @@ and Docker Compose (version 1.6.0 or greater) already installed.
|
||||
user@host:szuru$ export DOCKER_BUILDKIT=1; export COMPOSE_DOCKER_CLI_BUILD=1
|
||||
```
|
||||
|
||||
...and run `docker-compose build` again.
|
||||
...and run `docker compose build` again.
|
||||
|
||||
*Note: If your changes are not taking effect in your builds, consider building
|
||||
with `--no-cache`.*
|
||||
@ -117,7 +117,7 @@ with `--no-cache`.*
|
||||
run from docker:
|
||||
|
||||
```console
|
||||
user@host:szuru$ docker-compose run server ./szuru-admin --help
|
||||
user@host:szuru$ docker compose run server ./szuru-admin --help
|
||||
```
|
||||
|
||||
will give you a breakdown on all available commands.
|
||||
|
@ -1,9 +1,7 @@
|
||||
## Example Docker Compose configuration
|
||||
##
|
||||
## Use this as a template to set up docker-compose, or as guide to set up other
|
||||
## Use this as a template to set up docker compose, or as guide to set up other
|
||||
## orchestration services
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
|
||||
server:
|
||||
|
Reference in New Issue
Block a user