Skip to content

Commit

Permalink
Merge branch 'main' into MoveSelectionToAnotherPage
Browse files Browse the repository at this point in the history
  • Loading branch information
QubaB authored Jan 16, 2024
2 parents bc46c97 + 56784d6 commit b5c1609
Show file tree
Hide file tree
Showing 60 changed files with 93 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ If you like Saber, please consider supporting it by:
[google_play]: https://play.google.com/store/apps/details?id=com.adilhanney.saber
[snap]: https://snapcraft.io/saber
[app_store]: https://apps.apple.com/us/app/saber/id1671523739
[download_windows]: https://github.com/saber-notes/saber/releases/download/v0.19.1/SaberInstaller_v0.19.1.exe
[download_appimage]: https://github.com/saber-notes/saber/releases/download/v0.19.1/Saber-0.19.1-x86_64.AppImage
[download_windows]: https://github.com/saber-notes/saber/releases/download/v0.19.2/SaberInstaller_v0.19.2.exe
[download_appimage]: https://github.com/saber-notes/saber/releases/download/v0.19.2/Saber-0.19.2-x86_64.AppImage

[nextcloud]: https://nc.saber.adil.hanney.org/

Expand Down
5 changes: 5 additions & 0 deletions flatpak/com.adilhanney.saber.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@
</screenshots>

<releases>
<release version="0.19.2" type="development" date="2024-01-16">
<description>
<p>Strokes that had jagged edges have now been smoothed out, particularly ones drawn with a mouse or trackpad.</p>
</description>
</release>
<release version="0.19.1" type="development" date="2024-01-09">
<description>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion installers/desktop_inno_script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Saber"
#define MyAppVersion "0.19.1"
#define MyAppVersion "0.19.2"
#define MyAppPublisher "Adil Hanney"
#define MyAppURL "https://github.com/saber-notes/saber"
#define MyAppExeName "saber.exe"
Expand Down
2 changes: 1 addition & 1 deletion lib/components/canvas/_circle_stroke.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class CircleStroke extends Stroke {
.map((radians) => Offset(cos(radians), sin(radians)))
.map((unitDir) => unitDir * radius + center)
.toList();
_path = Path()..addPolygon(_polygon, true);
_path = Path()..addOval(Rect.fromCircle(center: center, radius: radius));
_polygonNeedsUpdating = false;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/components/canvas/_rectangle_stroke.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class RectangleStroke extends Stroke {

void _updatePolygon() {
_polygon = _getPolygon();
_path = Path()..addPolygon(_polygon, true);
_path = Path()..addRect(rect);
_polygonNeedsUpdating = false;
}

Expand Down
30 changes: 27 additions & 3 deletions lib/components/canvas/_stroke.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Stroke {

void _updatePolygon() {
_polygon = _getPolygon();
_path = Path()..addPolygon(_polygon, true);
_path = _getPath();
_polygonNeedsUpdating = false;
}

Expand Down Expand Up @@ -174,6 +174,9 @@ class Stroke {

final minDistance = options.size * thresholdMultiplier;

// Remove points with null pressure because they were duplicates
points.removeWhere((point) => point.pressure == null);

for (int i = 1; i < points.length - 1; i++) {
final point = points[i];
final prev = points[i - 1];
Expand Down Expand Up @@ -203,8 +206,6 @@ class Stroke {
if (rememberSimulatedPressure) {
// Ensure we don't simulate pressure again
options.simulatePressure = false;
// Remove points with null pressure because they were duplicates
points.removeWhere((point) => point.pressure == null);
// Remove points that are too close together
optimisePoints();
// Get polygon again with slightly different input
Expand All @@ -214,6 +215,29 @@ class Stroke {
return polygon;
}

/// Returns a [Path] that represents the stroke.
///
/// If the stroke is not complete,
/// the path will just follow the polygon for performance.
///
/// If the stroke is complete,
/// the path will be a smooth curve between the points.
Path _getPath() {
if (!options.isComplete) {
return Path()..addPolygon(_polygon, true);
}

final path = Path();
path.moveTo(_polygon.first.dx, _polygon.first.dy);
for (int i = 1; i < _polygon.length - 1; i++) {
final p1 = _polygon[i];
final p2 = _polygon[i + 1];
final mid = (p1 + p2) / 2;
path.quadraticBezierTo(p1.dx, p1.dy, mid.dx, mid.dy);
}
return path..close();
}

String toSvgPath(Size pageSize) {
String toSvgPoint(Offset point) {
return '${point.dx} '
Expand Down
4 changes: 3 additions & 1 deletion lib/data/tools/pen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ class Pen extends Tool {
currentStroke = Stroke(
color: color,
pressureEnabled: pressureEnabled,
options: options.copyWith(),
options: options.copyWith(
isComplete: false,
),
pageIndex: pageIndex,
penType: runtimeType.toString(),
);
Expand Down
4 changes: 2 additions & 2 deletions lib/data/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Run `./scripts/apply_version.sh --help` for more information.

/// The current app version as an ordinal number.
const int buildNumber = 19010;
const int buildNumber = 19020;

/// The current app version as a string.
const String buildName = '0.19.1';
const String buildName = '0.19.2';

/// The year in which the current version was released.
const int buildYear = 2024;
2 changes: 2 additions & 0 deletions metadata/ar/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
وقد تم الآن سلاسة الخنقات التي كانت تحمل حوافاً مزيفة، لا سيما تلك التي تم سحبها مع فأر أو صعقة.
.
1 change: 1 addition & 0 deletions metadata/ar/changelogs/190203.txt
1 change: 1 addition & 0 deletions metadata/cs/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Tahy, které měly zubaté okraje, byly nyní vyhlazeny, zejména ty kreslené myší nebo trackpadem.
1 change: 1 addition & 0 deletions metadata/cs/changelogs/190203.txt
2 changes: 2 additions & 0 deletions metadata/de/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Strokes, die geklemmte Kanten hatten, wurden nun geglättet, insbesondere mit einer Maus oder einem Trackpad gezogen.
.
1 change: 1 addition & 0 deletions metadata/de/changelogs/190203.txt
1 change: 1 addition & 0 deletions metadata/en-US/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Strokes that had jagged edges have now been smoothed out, particularly ones drawn with a mouse or trackpad.
1 change: 1 addition & 0 deletions metadata/en-US/changelogs/190203.txt
1 change: 1 addition & 0 deletions metadata/es/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Los trazos que tenían bordes irregulares ahora se han suavizado, en particular los dibujados con el mouse o el trackpad.
1 change: 1 addition & 0 deletions metadata/es/changelogs/190203.txt
2 changes: 2 additions & 0 deletions metadata/fa/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
سکته هایی که لبه های آویزان داشته اند اکنون صاف شده اند، به ویژه آنهایی که با یک ماوس یا ردیاب کشیده شده اند.
.
1 change: 1 addition & 0 deletions metadata/fa/changelogs/190203.txt
1 change: 1 addition & 0 deletions metadata/fr/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Les traits aux bords irréguliers ont désormais été lissés, en particulier ceux dessinés avec une souris ou un trackpad.
1 change: 1 addition & 0 deletions metadata/fr/changelogs/190203.txt
1 change: 1 addition & 0 deletions metadata/he/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
משיכות עם קצוות משוננים הוחלקו כעת, במיוחד אלה שצוירו באמצעות עכבר או משטח עקיבה.
1 change: 1 addition & 0 deletions metadata/he/changelogs/190203.txt
1 change: 1 addition & 0 deletions metadata/hu/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A szaggatott élekkel rendelkező vonásokat most kisimítottuk, különösen az egérrel vagy görgetőpaddal rajzolottakat.
1 change: 1 addition & 0 deletions metadata/hu/changelogs/190203.txt
1 change: 1 addition & 0 deletions metadata/it/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I tratti che presentavano bordi frastagliati ora sono stati smussati, in particolare quelli disegnati con il mouse o il trackpad.
1 change: 1 addition & 0 deletions metadata/it/changelogs/190203.txt
1 change: 1 addition & 0 deletions metadata/ja/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
特にマウスやトラックパッドで描画されたストロークなど、ギザギザのエッジがあったストロークが滑らかになりました。
1 change: 1 addition & 0 deletions metadata/ja/changelogs/190203.txt
2 changes: 2 additions & 0 deletions metadata/pt-BR/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Os traços que tinham bordas irregulares foram alisados, particularmente aqueles desenhados com um mouse ou trackpad.
.
1 change: 1 addition & 0 deletions metadata/pt-BR/changelogs/190203.txt
1 change: 1 addition & 0 deletions metadata/ru/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Штрихи с неровными краями теперь сглажены, особенно те, которые нарисованы с помощью мыши или трекпада.
1 change: 1 addition & 0 deletions metadata/ru/changelogs/190203.txt
2 changes: 2 additions & 0 deletions metadata/tr/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Şimdi jagged kenarları olan 0.00s, özellikle bir fare ya da izpad ile çizilenler.
.
1 change: 1 addition & 0 deletions metadata/tr/changelogs/190203.txt
1 change: 1 addition & 0 deletions metadata/zh-Hans-CN/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
具有锯齿状边缘的笔画现在已被平滑,特别是使用鼠标或触控板绘制的笔画。
1 change: 1 addition & 0 deletions metadata/zh-Hans-CN/changelogs/190203.txt
1 change: 1 addition & 0 deletions metadata/zh-Hant-TW/changelogs/19020.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
具有鋸齒狀邊緣的筆畫現在已被平滑,特別是使用滑鼠或觸控板繪製的筆畫。
1 change: 1 addition & 0 deletions metadata/zh-Hant-TW/changelogs/190203.txt
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.19.1+19010
version: 0.19.2+19020

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down
10 changes: 10 additions & 0 deletions scripts/translate_changelogs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ void main() async {
}

// Response might be something like "Invalid request: request (276) exceeds text limit (250)"
const failurePrefixes = [
'Invalid request: request (',
'None is not supported',
];
if (failurePrefixes.any(translatedChangelog.startsWith)) {
print('${' ' * stepPrefix.length} ! Translation invalid, skipping...');
someTranslationsFailed = true;
continue;
}

const bullet = '•';
if (englishChangelog.contains(bullet) &&
!translatedChangelog.contains(bullet)) {
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ parts:
saber:
after: [rustup]
source: https://github.com/saber-notes/saber.git
source-tag: 'v0.19.1'
source-tag: 'v0.19.2'
plugin: flutter
#build-attributes: [enable-patchelf]
build-packages:
Expand Down
Binary file modified test/sbn_examples/v17_squiggles.sbn2.dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/sbn_examples/v17_squiggles.sbn2.light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/sbn_examples/v18_highlighter.sbn2.dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/sbn_examples/v18_highlighter.sbn2.light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/sbn_examples/v18_highlighter.sbn2.pdf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/sbn_examples/v18_pencil.sbn2.dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/sbn_examples/v18_pencil.sbn2.light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/sbn_examples/v18_pencil.sbn2.pdf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/sbn_examples/v19_pens.sbn2
Binary file not shown.
Binary file added test/sbn_examples/v19_pens.sbn2.dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/sbn_examples/v19_pens.sbn2.light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/sbn_examples/v19_pens.sbn2.pdf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/sbn_examples/v6_stress_test_179.sbn.dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/sbn_examples/v6_stress_test_179.sbn.light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/sbn_examples/v9_single_stroke.sbn.dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/sbn_examples/v9_single_stroke.sbn.light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions windows/runner/Runner.rc
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ IDI_APP_ICON ICON "resources\\app_icon.ico"
#ifdef FLUTTER_BUILD_NUMBER
#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
#else
#define VERSION_AS_NUMBER 0,19,1,0
#define VERSION_AS_NUMBER 0,19,2,0
#endif

#ifdef FLUTTER_BUILD_NAME
#define VERSION_AS_STRING #FLUTTER_BUILD_NAME
#else
#define VERSION_AS_STRING "0.19.1.0"
#define VERSION_AS_STRING "0.19.2.0"
#endif

VS_VERSION_INFO VERSIONINFO
Expand Down

0 comments on commit b5c1609

Please sign in to comment.