/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! This example creates a 200x200 white rect and allows the user to move it //! around by using the arrow keys and rotate with '<'/'>'. //! It does this by using the animation API.
//! The example also features seamless opaque/transparent split of a //! rounded cornered rectangle, which is done automatically during the //! scene building for render optimization.
#[path = "common/boilerplate.rs"] mod boilerplate;
usecrate::boilerplate::{Example, HandyDandyRectBuilder}; use euclid::Angle; use webrender::api::*; use webrender::render_api::*; use webrender::api::units::*;
let space_and_clip = SpaceAndClipInfo {
spatial_id,
clip_chain_id: ClipChainId::INVALID,
}; let clip_bounds = LayoutRect::from_size(bounds.size()); let complex_clip = ComplexClipRegion {
rect: clip_bounds,
radii: BorderRadius::uniform(30.0),
mode: ClipMode::Clip,
}; let clip_id = builder.define_clip_rounded_rect(
space_and_clip.spatial_id,
complex_clip,
); let clip_chain_id = builder.define_clip_chain(None, [clip_id]);
// Fill it with a white rect
builder.push_rect(
&CommonItemProperties::new(
LayoutRect::from_size(bounds.size()),
SpaceAndClipInfo {
spatial_id,
clip_chain_id,
}
),
LayoutRect::from_size(bounds.size()),
color,
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.