mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
bounds -> rect
This commit is contained in:
@@ -310,9 +310,9 @@ mate::Handle<NativeImage> NativeImage::Resize(
|
||||
}
|
||||
|
||||
mate::Handle<NativeImage> NativeImage::Crop(v8::Isolate* isolate,
|
||||
const gfx::Rect& bounds) {
|
||||
const gfx::Rect& rect) {
|
||||
gfx::ImageSkia cropped = gfx::ImageSkiaOperations::ExtractSubset(
|
||||
image_.AsImageSkia(), bounds);
|
||||
image_.AsImageSkia(), rect);
|
||||
return mate::CreateHandle(isolate,
|
||||
new NativeImage(isolate, gfx::Image(cropped)));
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class NativeImage : public mate::Wrappable<NativeImage> {
|
||||
mate::Handle<NativeImage> Resize(v8::Isolate* isolate,
|
||||
const base::DictionaryValue& options);
|
||||
mate::Handle<NativeImage> Crop(v8::Isolate* isolate,
|
||||
const gfx::Rect& bounds);
|
||||
const gfx::Rect& rect);
|
||||
std::string ToDataURL();
|
||||
bool IsEmpty();
|
||||
gfx::Size GetSize();
|
||||
|
||||
@@ -215,9 +215,9 @@ Marks the image as a template image.
|
||||
|
||||
Returns `Boolean` - Whether the image is a template image.
|
||||
|
||||
#### `image.crop(region)`
|
||||
#### `image.crop(rect)`
|
||||
|
||||
* `region` Object - The region of the image to crop
|
||||
* `rect` Object - The area of the image to crop
|
||||
* `x` Integer
|
||||
* `y` Integer
|
||||
* `width` Integer
|
||||
|
||||
Reference in New Issue
Block a user