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
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ canvas.toDataURL('image/jpeg', {opts...}, function(err, jpeg){ }); // see Canvas
canvas.toDataURL('image/jpeg', quality, function(err, jpeg){ }); // spec-following; quality from 0 to 1
```

### CanvasRenderingContext2d#patternQuality
### CanvasRenderingContext2D#patternQuality

Given one of the values below will alter pattern (gradients, images, etc) render quality, defaults to _good_.

Expand All @@ -180,15 +180,15 @@ Given one of the values below will alter pattern (gradients, images, etc) render
- nearest
- bilinear

### CanvasRenderingContext2d#textDrawingMode
### CanvasRenderingContext2D#textDrawingMode

Can be either `path` or `glyph`. Using `glyph` is much faster than `path` for drawing, and when using a PDF context will embed the text natively, so will be selectable and lower filesize. The downside is that cairo does not have any subpixel precision for `glyph`, so this will be noticeably lower quality for text positioning in cases such as rotated text. Also, strokeText in `glyph` will act the same as fillText, except using the stroke style for the fill.

Defaults to _path_.

This property is tracked as part of the canvas state in save/restore.

### CanvasRenderingContext2d#filter
### CanvasRenderingContext2D#filter

Like `patternQuality`, but applies to transformations effecting more than just patterns. Defaults to _good_.

Expand Down
2 changes: 1 addition & 1 deletion src/CanvasRenderingContext2d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Context2d::Initialize(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target) {
Local<FunctionTemplate> ctor = Nan::New<FunctionTemplate>(Context2d::New);
constructor.Reset(ctor);
ctor->InstanceTemplate()->SetInternalFieldCount(1);
ctor->SetClassName(Nan::New("CanvasRenderingContext2d").ToLocalChecked());
ctor->SetClassName(Nan::New("CanvasRenderingContext2D").ToLocalChecked());

// Prototype
Local<ObjectTemplate> proto = ctor->PrototypeTemplate();
Expand Down