Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a small bug in canvas quads with fixed scale #985

Merged
merged 1 commit into from
Apr 3, 2019
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
### Changes
- The point clustering radius value is now in display pixels (#983)

### Bug Fixes
- Fixed drawing partial fixed-scale canvas quads (#985)

## Version 0.19.2

### Improvements
Expand Down
4 changes: 2 additions & 2 deletions src/canvas/quadFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ var canvas_quadFeature = function (arg) {
if (!quad.crop) {
context2d.drawImage(src, 0, 0);
} else {
var cropx = Math.min(src.w, quad.crop.x),
cropy = Math.min(src.h, quad.crop.y);
var cropx = Math.min(w, quad.crop.x),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the difference between src.w and w? do they point to different values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w is a local variable that was taken from src.width or src.videoWidth. src.w was incorrect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, thans.

cropy = Math.min(h, quad.crop.y);
if (cropx > 0 && cropy > 0) {
context2d.drawImage(src, 0, 0, cropx, cropy, 0, 0, cropx, cropy);
}
Expand Down