chanind / hanzi-writer

Chinese character stroke order animations and practice quizzes
https://hanziwriter.org
MIT License
3.47k stars 539 forks source link

feat: adding writer.updateDimensions method #245

Closed chanind closed 3 years ago

chanind commented 3 years ago

This PR adds an updateDimensions({ width, height, padding }) method, which will update the size of an existing HanziWriter instance without needing to recreate the instance and without needing to reset the render state.

closes #244

codecov-commenter commented 3 years ago

Codecov Report

Merging #245 (ec178f8) into master (3766a8b) will decrease coverage by 0.11%. The diff coverage is 92.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #245      +/-   ##
==========================================
- Coverage   96.18%   96.07%   -0.12%     
==========================================
  Files          32       32              
  Lines        1102     1121      +19     
  Branches      196      202       +6     
==========================================
+ Hits         1060     1077      +17     
- Misses         38       40       +2     
  Partials        4        4              
Impacted Files Coverage Δ
src/Quiz.ts 94.36% <0.00%> (-1.35%) :arrow_down:
src/HanziWriter.ts 93.92% <95.23%> (-0.06%) :arrow_down:
src/RenderState.ts 98.11% <100.00%> (+0.03%) :arrow_up:
src/renderers/RenderTargetBase.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3766a8b...ec178f8. Read the comment docs.

chanind commented 3 years ago

:tada: This PR is included in version 3.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: