Skip to content

Commit 0796626

Browse files
committed
Revert the effects of extraneous commit a92035c
1 parent a92035c commit 0796626

File tree

14 files changed

+15
-84
lines changed

14 files changed

+15
-84
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66

77
# Editor/IDE temporary files
88
.*.sw*
9-
.vscode/*
10-
Cargo.lock
9+
.vscode/*

CHANGELOG.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22

33
## Plotters latest
44

5-
## Plotters 0.3.4 (?)
6-
7-
## Plotters 0.3.3 (2022-08-19)
8-
9-
### Improved
10-
11-
- The EvcxR integration now supports bitmap output. (Thanks to @lisanhu)
12-
13-
### Fixed
14-
15-
- Fix the plotters crate's edition requirement
16-
175
## Plotters 0.3.2 (2022-07-05)
186

197
- Added

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[workspace]
22
members = ["plotters", "plotters-backend", "plotters-bitmap", "plotters-svg"]
33
default-members = ["plotters"]
4+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ extern crate plotters;
226226
use plotters::prelude::*;
227227
228228
let figure = evcxr_figure((640, 480), |root| {
229-
root.fill(&WHITE)?;
229+
root.fill(&WHITE);
230230
let mut chart = ChartBuilder::on(&root)
231231
.caption("y=x^2", ("Arial", 50).into_font())
232232
.margin(5)

doc-template/latest_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.3
1+
0.3.2

plotters-bitmap/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ gif = { version = "0.11.2", optional = true }
1818
path = "../plotters-backend"
1919

2020
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.image]
21-
version = "0.24.3"
21+
version = "0.24.2"
2222
optional = true
2323
default-features = false
2424
features = ["jpeg", "png", "bmp"]

plotters-svg/Cargo.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,8 @@ readme = "README.md"
1414
[dependencies.plotters-backend]
1515
path = "../plotters-backend"
1616

17-
[dependencies.image]
18-
version = "0.24.2"
19-
optional = true
20-
default-features = false
21-
features = ["jpeg", "png", "bmp"]
22-
2317
[features]
2418
debug = []
25-
bitmap_encoder = ["image"]
2619

2720
[dev-dependencies.plotters]
2821
default_features = false

plotters-svg/src/svg.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,19 +487,18 @@ impl<'a> DrawingBackend for SVGBackend<'a> {
487487
(w, h): (u32, u32),
488488
src: &'b [u8],
489489
) -> Result<(), DrawingErrorKind<Self::ErrorType>> {
490-
use image::codecs::png::PngEncoder;
491-
use image::ImageEncoder;
490+
use image::png::PNGEncoder;
492491

493492
let mut data = vec![0; 0];
494493

495494
{
496495
let cursor = Cursor::new(&mut data);
497496

498-
let encoder = PngEncoder::new(cursor);
497+
let encoder = PNGEncoder::new(cursor);
499498

500-
let color = image::ColorType::Rgb8;
499+
let color = image::ColorType::RGB(8);
501500

502-
encoder.write_image(src, w, h, color).map_err(|e| {
501+
encoder.encode(src, w, h, color).map_err(|e| {
503502
DrawingErrorKind::DrawingError(Error::new(
504503
std::io::ErrorKind::Other,
505504
format!("Image error: {}", e),

plotters/Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "plotters"
33
version = "0.4.0"
44
authors = ["Hao Hou <haohou302@gmail.com>"]
5-
edition = "2018"
5+
edition = "2021"
66
license = "MIT"
77
description = "A Rust drawing library focus on data plotting for both WASM and native applications"
88
repository = "https://github.com/plotters-rs/plotters"
@@ -14,7 +14,7 @@ exclude = ["doc-template", "plotters-doc-data"]
1414

1515
[dependencies]
1616
num-traits = "0.2.14"
17-
chrono = { version = "0.4.20", optional = true }
17+
chrono = { version = "0.4.19", optional = true }
1818

1919
[dependencies.plotters-backend]
2020
path = "../plotters-backend"
@@ -36,7 +36,7 @@ pathfinder_geometry = { version = "0.5.1", optional = true }
3636
font-kit = { version = "0.11.0", optional = true }
3737

3838
[target.'cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))'.dependencies.image]
39-
version = "0.24.3"
39+
version = "0.24.2"
4040
optional = true
4141
default-features = false
4242
features = ["jpeg", "png", "bmp"]
@@ -100,16 +100,15 @@ fontconfig-dlopen = ["font-kit/source-fontconfig-dlopen"]
100100
# Misc
101101
datetime = ["chrono"]
102102
evcxr = ["svg_backend"]
103-
evcxr_bitmap = ["evcxr", "bitmap_backend", "plotters-svg/bitmap_encoder"]
104103
deprecated_items = [] # Keep some of the deprecated items for backward compatibility
105104

106105
[dev-dependencies]
107106
itertools = "0.10.0"
108107
criterion = "0.3.6"
109108
rayon = "1.5.1"
110109
serde_json = "1.0.82"
111-
serde = "1.0.139"
112-
serde_derive = "1.0.140"
110+
serde = "1.0.138"
111+
serde_derive = "1.0.138"
113112

114113
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
115114
rand = "0.8.3"

plotters/src/drawing/backend_impl/mocked.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,6 @@ impl DrawingBackend for MockedBackend {
269269

270270
impl Drop for MockedBackend {
271271
fn drop(&mut self) {
272-
// `self.drop_check` is typically a testing function; it can panic.
273-
// The current `drop` call may be a part of stack unwinding caused
274-
// by another panic. If so, we should never call it.
275-
if std::thread::panicking() {
276-
return;
277-
}
278-
279272
let mut temp = None;
280273
std::mem::swap(&mut temp, &mut self.drop_check);
281274

0 commit comments

Comments
 (0)