Skip to content

Commit

Permalink
1.1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
espresso3389 committed Feb 19, 2025
1 parent f2f39d7 commit 254cfd5
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.1.11

- Color.withOpacity -> Color.withValues, Color.value -> Color.toARGB32()

# 1.1.10

- Update project structure to conform to [Package layout conventions](https://dart.dev/tools/pub/package-layout)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Add this to your package's `pubspec.yaml` file and execute `flutter pub get`:

```yaml
dependencies:
pdfrx: ^1.1.10
pdfrx: ^1.1.11
```
### Note for Windows
Expand All @@ -69,7 +69,7 @@ This is still not production-ready, but you can try it by adding additional [pdf
```yaml
dependencies:
pdfrx: ^1.1.10
pdfrx: ^1.1.11
pdfrx_wasm: ^1.1.6
```
Expand Down
2 changes: 1 addition & 1 deletion example/viewer/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ packages:
path: "../.."
relative: true
source: path
version: "1.1.10"
version: "1.1.11"
platform:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/pdfium/pdfrx_pdfium.dart
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ class PdfPagePdfium extends PdfPage {
height: height!,
fullWidth: fullWidth!.toInt(),
fullHeight: fullHeight!.toInt(),
backgroundColor: backgroundColor!.value,
backgroundColor: backgroundColor!.toARGB32(),
annotationRenderingMode: annotationRenderingMode,
formHandle: document.formHandle.address,
formInfo: document.formInfo.address,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/web/pdfrx_js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ class PdfPageJs extends PdfPage {
canvas.height = height;

if (backgroundColor != null) {
canvas.context2D.fillStyle = '#${backgroundColor.value.toRadixString(16).padLeft(8, '0')}'.toJS;
canvas.context2D.fillStyle = '#${backgroundColor.toARGB32().toRadixString(16).padLeft(8, '0')}'.toJS;
canvas.context2D.fillRect(0, 0, width, height);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/web/pdfrx_wasm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class PdfPageWasm extends PdfPage {
'height': height,
'fullWidth': fullWidth,
'fullHeight': fullHeight,
'backgroundColor': backgroundColor.value,
'backgroundColor': backgroundColor.toARGB32(),
'annotationRenderingMode': annotationRenderingMode.index,
'formHandle': document.document['formHandle'],
},
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/pdf_text_searcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ class PdfTextSearcher extends Listenable {
final range = getMatchesRangeForPage(page.pageNumber);
if (range == null) return;

final matchTextColor = controller?.params.matchTextColor ?? Colors.yellow.withOpacity(0.5);
final activeMatchTextColor = controller?.params.activeMatchTextColor ?? Colors.orange.withOpacity(0.5);
final matchTextColor = controller?.params.matchTextColor ?? Colors.yellow.withAlpha(127);
final activeMatchTextColor = controller?.params.activeMatchTextColor ?? Colors.orange.withAlpha(127);

for (int i = range.start; i < range.end; i++) {
final m = _matches[i];
Expand Down
8 changes: 2 additions & 6 deletions lib/src/widgets/pdf_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1979,17 +1979,13 @@ extension RectExt on Rect {
/// Create a [CustomPainter] from a paint function.
class _CustomPainter extends CustomPainter {
/// Create a [CustomPainter] from a paint function.
const _CustomPainter.fromFunctions(this.paintFunction, {this.hitTestFunction});
const _CustomPainter.fromFunctions(this.paintFunction);
final void Function(ui.Canvas canvas, ui.Size size) paintFunction;
final bool Function(Offset position)? hitTestFunction;
@override
void paint(ui.Canvas canvas, ui.Size size) => paintFunction(canvas, size);

@override
bool shouldRepaint(covariant CustomPainter oldDelegate) => true;

@override
bool? hitTest(ui.Offset position) => hitTestFunction == null ? super.hitTest(position) : hitTestFunction!(position);
}

Widget _defaultErrorBannerBuilder(
Expand Down Expand Up @@ -2112,7 +2108,7 @@ class _CanvasLinkPainter {

final paint =
Paint()
..color = _state.widget.params.linkHandlerParams?.linkColor ?? Colors.blue.withOpacity(0.2)
..color = _state.widget.params.linkHandlerParams?.linkColor ?? Colors.blue.withAlpha(50)
..style = PaintingStyle.fill;
for (final link in links) {
for (final rect in link.rects) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/pdf_viewer_scroll_thumb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class _PdfViewerScrollThumbState extends State<PdfViewerScrollThumb> {
borderRadius: BorderRadius.circular(5),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.5),
color: Colors.black.withAlpha(127),
spreadRadius: 1,
blurRadius: 1,
offset: const Offset(1, 1),
Expand Down Expand Up @@ -117,7 +117,7 @@ class _PdfViewerScrollThumbState extends State<PdfViewerScrollThumb> {
borderRadius: BorderRadius.circular(5),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.5),
color: Colors.black.withAlpha(127),
spreadRadius: 1,
blurRadius: 1,
offset: const Offset(1, 1),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pdfrx
description: pdfrx is a rich and fast PDF viewer implementation built on the top of PDFium. The plugin supports Android, iOS, Windows, macOS, Linux, and Web.
version: 1.1.10
version: 1.1.11
homepage: https://github.com/espresso3389/pdfrx

environment:
Expand Down

0 comments on commit 254cfd5

Please sign in to comment.