Пример #1
0
TileCoverageMap::TileCoverageMap(const TileController& controller)
    : m_controller(controller)
    , m_layer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeSimpleLayer, this))
    , m_visibleRectIndicatorLayer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
    , m_coverageRectIndicatorLayer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
    , m_position(FloatPoint(0, controller.topContentInset()))
{
    m_layer.get().setOpacity(0.75);
    m_layer.get().setAnchorPoint(FloatPoint3D());
    m_layer.get().setBorderColor(Color::black);
    m_layer.get().setBorderWidth(1);
    m_layer.get().setPosition(FloatPoint(2, 2));
    m_layer.get().setContentsScale(m_controller.deviceScaleFactor());

    m_visibleRectIndicatorLayer.get().setBorderWidth(2);
    m_visibleRectIndicatorLayer.get().setAnchorPoint(FloatPoint3D());
    m_visibleRectIndicatorLayer.get().setBorderColor(Color(255, 0, 0));
    
    m_coverageRectIndicatorLayer.get().setBorderWidth(2);
    m_coverageRectIndicatorLayer.get().setAnchorPoint(FloatPoint3D());
    m_coverageRectIndicatorLayer.get().setBorderColor(Color(0, 0, 128));

    m_layer.get().appendSublayer(m_coverageRectIndicatorLayer);
    m_layer.get().appendSublayer(m_visibleRectIndicatorLayer);

    update();
}
Пример #2
0
TileGrid::TileGrid(TileController& controller)
    : m_controller(controller)
    , m_containerLayer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
    , m_scale(1)
    , m_cohortRemovalTimer(*this, &TileGrid::cohortRemovalTimerFired)
{
    m_containerLayer.get().setName(TileController::tileGridContainerLayerName());
}