Skip to content

Commit

Permalink
Revert "constellation: Cleanup the frame size handler."
Browse files Browse the repository at this point in the history
This reverts commit 79ef206.
  • Loading branch information
mbrubeck committed Jan 24, 2017
1 parent 7595a90 commit 58e8ae8
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions components/constellation/constellation.rs
Expand Up @@ -1329,26 +1329,23 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
fn handle_frame_size_msg(&mut self,
iframe_sizes: Vec<(PipelineId, TypedSize2D<f32, PagePx>)>) {
for (pipeline_id, size) in iframe_sizes {
let result = {
let pipeline = match self.pipelines.get_mut(&pipeline_id) {
Some(pipeline) => pipeline,
None => continue,
};

if pipeline.size == Some(size) {
continue;
let result = match self.pipelines.get_mut(&pipeline_id) {
Some(pipeline) => {
if pipeline.size != Some(size) {
pipeline.size = Some(size);
let msg = ConstellationControlMsg::Resize(pipeline_id, WindowSizeData {
visible_viewport: size,
initial_viewport: size * ScaleFactor::new(1.0),
device_pixel_ratio: self.window_size.device_pixel_ratio,
}, WindowSizeType::Initial);
Some(pipeline.event_loop.send(msg))
} else {
None
}
}

pipeline.size = Some(size);
let msg = ConstellationControlMsg::Resize(pipeline_id, WindowSizeData {
visible_viewport: size,
initial_viewport: size * ScaleFactor::new(1.0),
device_pixel_ratio: self.window_size.device_pixel_ratio,
}, WindowSizeType::Initial);

pipeline.event_loop.send(msg)
None => None
};
if let Err(e) = result {
if let Some(Err(e)) = result {
self.handle_send_error(pipeline_id, e);
}
}
Expand Down

0 comments on commit 58e8ae8

Please sign in to comment.