Skip to content
Merged
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 golden/dart.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 golden/flutter_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 golden/simple/opacity_on_path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 golden/simple/radial_gradient_focal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 golden/w3samples/aa.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 golden/wikimedia/Ghostscript_Tiger.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 golden/wikimedia/chess_knight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/src/picture_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ class NetworkPicture extends PictureProvider<NetworkPicture> {
}
final HttpClientResponse response = await request.close();

if (response.statusCode != HttpStatus.OK) {
if (response.statusCode != HttpStatus.ok) {
throw new HttpException('Could not get network asset', uri: uri);
}
final Uint8List bytes = await consolidateHttpClientResponseBytes(response);
Expand Down
18 changes: 9 additions & 9 deletions lib/src/svg/parsers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,17 @@ Matrix4 _parseSvgMatrix(String paramsStr, Matrix4 current) {
final double e = double.parse(params[4]);
final double f = double.parse(params[5]);

return _affineMatrix(a, b, c, d, e, f).multiplied(current);
return affineMatrix(a, b, c, d, e, f).multiplied(current);
}

Matrix4 _parseSvgSkewX(String paramsStr, Matrix4 current) {
final double x = double.parse(paramsStr);
return _affineMatrix(1.0, 0.0, tan(x), 1.0, 0.0, 0.0).multiplied(current);
return affineMatrix(1.0, 0.0, tan(x), 1.0, 0.0, 0.0).multiplied(current);
}

Matrix4 _parseSvgSkewY(String paramsStr, Matrix4 current) {
final double y = double.parse(paramsStr);
return _affineMatrix(1.0, tan(y), 0.0, 1.0, 0.0, 0.0).multiplied(current);
return affineMatrix(1.0, tan(y), 0.0, 1.0, 0.0, 0.0).multiplied(current);
}

Matrix4 _parseSvgTranslate(String paramsStr, Matrix4 current) {
Expand All @@ -135,7 +135,7 @@ Matrix4 _parseSvgTranslate(String paramsStr, Matrix4 current) {
assert(params.length <= 2);
final double x = double.parse(params[0]);
final double y = params.length < 2 ? x : double.parse(params[1]);
return _affineMatrix(1.0, 0.0, 0.0, 1.0, x, y).multiplied(current);
return affineMatrix(1.0, 0.0, 0.0, 1.0, x, y).multiplied(current);
}

Matrix4 _parseSvgScale(String paramsStr, Matrix4 current) {
Expand All @@ -144,7 +144,7 @@ Matrix4 _parseSvgScale(String paramsStr, Matrix4 current) {
assert(params.length <= 2);
final double x = double.parse(params[0]);
final double y = params.length < 2 ? x : double.parse(params[1]);
return _affineMatrix(x, 0.0, 0.0, y, 0.0, 0.0).multiplied(current);
return affineMatrix(x, 0.0, 0.0, y, 0.0, 0.0).multiplied(current);
}

Matrix4 _parseSvgRotate(String paramsStr, Matrix4 current) {
Expand All @@ -153,21 +153,21 @@ Matrix4 _parseSvgRotate(String paramsStr, Matrix4 current) {
final double a = radians(double.parse(params[0]));

final Matrix4 rotate =
_affineMatrix(cos(a), sin(a), -sin(a), cos(a), 0.0, 0.0);
affineMatrix(cos(a), sin(a), -sin(a), cos(a), 0.0, 0.0);

if (params.length > 1) {
final double x = double.parse(params[1]);
final double y = params.length == 3 ? double.parse(params[2]) : x;
return _affineMatrix(1.0, 0.0, 0.0, 1.0, x, y)
return affineMatrix(1.0, 0.0, 0.0, 1.0, x, y)
.multiplied(current)
.multiplied(rotate)
.multiplied(_affineMatrix(1.0, 0.0, 0.0, 1.0, -x, -y));
.multiplied(affineMatrix(1.0, 0.0, 0.0, 1.0, -x, -y));
} else {
return rotate.multiplied(current);
}
}

Matrix4 _affineMatrix(
Matrix4 affineMatrix(
Comment thread
dnfield marked this conversation as resolved.
double a, double b, double c, double d, double e, double f) {
return new Matrix4(
a, b, 0.0, 0.0, c, d, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, e, f, 0.0, 1.0);
Expand Down
Loading