MCPcopy Create free account
hub / github.com/9miao/CrossApp / updateViewFrame

Method updateViewFrame

CrossApp/controller/CADrawerController.cpp:286–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286void CADrawerController::updateViewFrame()
287{
288 DPoint point[2] =
289 {
290 DPoint(m_fCurrDivision - m_fDivision, 0),
291 DPoint(m_fCurrDivision, 0)
292 };
293
294 if (m_bEffect3D)
295 {
296 float scale0 = 0.5f + 0.5f * m_fCurrDivision / m_fDivision;
297 float scale1 = 1.0f - powf(m_fCurrDivision / m_fDivision, 2) * 0.2f;
298
299 m_pContainer[0]->setAlpha(m_fCurrDivision / m_fDivision);
300 m_pContainer[0]->setScale(scale0);
301 m_pContainer[1]->setScale(scale1);
302 point[0].x = (m_fCurrDivision - m_fDivision) / 3;
303 }
304 else
305 {
306 m_pContainer[0]->setScale(1);
307 m_pContainer[1]->setScale(1);
308 }
309
310 DLayout layout[2];
311 layout[0] = m_rHideLayout[0];
312 layout[0].horizontal.left = point[0].x;
313
314 layout[1] = m_rHideLayout[1];
315 layout[1].horizontal.left = point[1].x;
316 layout[1].horizontal.right = -point[1].x;
317
318 for (int i=0; i<2; i++)
319 {
320 m_pContainer[i]->setLayout(layout[i]);
321 }
322}
323
324void CADrawerController::scheduleShowAction(float dt)
325{

Callers 6

scheduleShowActionMethod · 0.95
scheduleHideActionMethod · 0.95
ccTouchMovedMethod · 0.95

Calls 4

DPointClass · 0.85
setScaleMethod · 0.80
setLayoutMethod · 0.80
setAlphaMethod · 0.45

Tested by

no test coverage detected