Skip to content

Commit a4b89d9

Browse files
mikebarkmingithub-actions[bot]
authored andcommitted
chore: release v5.3.0
1 parent eb2a861 commit a4b89d9

4 files changed

Lines changed: 32 additions & 32 deletions

File tree

.changeset/text-centred-and-layered.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

.changeset/window-built-by-java.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,39 @@
11
---
22
name: Changelog
3-
index: 66
3+
index: 67
44
lang: en
55
---
66

7+
## 5.3.0
8+
9+
10+
11+
Plain text now sits on the position it was given. It used to be drawn eight
12+
pixels down and to the right of it - the padding a framed style needs between
13+
its border and its words, which plain words have no use for - so a centred label
14+
never landed on the thing it labelled: a number put at the middle of a line came
15+
out beside it. The words are now centred on their position, the way a sprite put
16+
there is.
17+
18+
A width too narrow to hold a single letter no longer wraps the words at all. It
19+
used to turn them into a column of one letter per line: `new Text("42", x, y, 1)`
20+
drew a 4 above a 2. Line breaks written into the text are still kept.
21+
22+
`Text` can also be layered like a sprite: `goToFrontLayer()`, `goToBackLayer()`,
23+
`goLayersForwards(int)` and `goLayersBackwards(int)` decide which of several
24+
overlapping texts is on top. Texts are drawn above the sprites, so this orders a
25+
text against the other texts.
26+
27+
28+
A class that extends `Window` and has a `main` method which is not static no
29+
longer fails with "Cannot create multiple Windows!". Since Java 21 the JVM
30+
builds an instance of such a class before it calls `main`, so the
31+
`new MyWindow()` inside `main` was the second window and the project stopped
32+
before it started. That window is now reused, and a note explains how to be rid
33+
of the extra one by making `main` static. Two windows asked for by the project
34+
itself are still an error.
35+
36+
737
## 5.2.0
838

939

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>org.openpatch</groupId>
77
<artifactId>scratch</artifactId>
8-
<version>5.2.0</version>
8+
<version>5.3.0</version>
99
<packaging>jar</packaging>
1010

1111
<name>Scratch for Java</name>

0 commit comments

Comments
 (0)