feat: add displayFrequency to Display object (#26472)

This commit is contained in:
Shelley Vohr 2020-11-16 15:33:51 -08:00 committed by GitHub
parent f65db1df79
commit 6f6c1b7ca6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 0 deletions

View file

@ -10,6 +10,7 @@
* `colorSpace` String - represent a color space (three-dimensional object which contains all realizable color combinations) for the purpose of color conversions * `colorSpace` String - represent a color space (three-dimensional object which contains all realizable color combinations) for the purpose of color conversions
* `colorDepth` Number - The number of bits per pixel. * `colorDepth` Number - The number of bits per pixel.
* `depthPerComponent` Number - The number of bits per color component. * `depthPerComponent` Number - The number of bits per color component.
* `displayFrequency` Number - The display refresh rate.
* `bounds` [Rectangle](rectangle.md) * `bounds` [Rectangle](rectangle.md)
* `size` [Size](size.md) * `size` [Size](size.md)
* `workArea` [Rectangle](rectangle.md) * `workArea` [Rectangle](rectangle.md)

View file

@ -151,6 +151,7 @@ v8::Local<v8::Value> Converter<display::Display>::ToV8(
dict.Set("colorSpace", val.color_spaces().GetRasterColorSpace().ToString()); dict.Set("colorSpace", val.color_spaces().GetRasterColorSpace().ToString());
dict.Set("depthPerComponent", val.depth_per_component()); dict.Set("depthPerComponent", val.depth_per_component());
dict.Set("size", val.size()); dict.Set("size", val.size());
dict.Set("displayFrequency", val.display_frequency());
dict.Set("workAreaSize", val.work_area_size()); dict.Set("workAreaSize", val.work_area_size());
dict.Set("scaleFactor", val.device_scale_factor()); dict.Set("scaleFactor", val.device_scale_factor());
dict.Set("rotation", val.RotationAsDegree()); dict.Set("rotation", val.RotationAsDegree());

View file

@ -30,6 +30,7 @@ describe('screen module', () => {
expect(display).to.have.property('depthPerComponent').that.is.a('number'); expect(display).to.have.property('depthPerComponent').that.is.a('number');
expect(display).to.have.property('colorDepth').that.is.a('number'); expect(display).to.have.property('colorDepth').that.is.a('number');
expect(display).to.have.property('colorSpace').that.is.a('string'); expect(display).to.have.property('colorSpace').that.is.a('string');
expect(display).to.have.property('displayFrequency').that.is.a('number');
}); });
it('has a size object property', function () { it('has a size object property', function () {