Skip to content

Commit

Permalink
Tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
felixpalmer committed Jan 26, 2022
1 parent a3315a4 commit 97be55a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 2 additions & 0 deletions modules/core/src/effects/mask/mask-effect.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export default class MaskEffect extends Effect {

const bounds = getMaskBounds({layers: maskLayers, viewport});

// TODO if the mask layer's data has changed and the data bounds are clipped
// by the viewport, this condition will prevent the mask from rerendering
if (!equals(bounds, this.lastBounds)) {
this.lastBounds = bounds;

Expand Down
1 change: 0 additions & 1 deletion modules/core/src/lib/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ const defaultProps = {
pickable: false,
opacity: {type: 'number', min: 0, max: 1, value: 1},
operation: OPERATION.DRAW,
maskEnabled: {type: 'boolean', value: true, optional: true},

onHover: {type: 'function', value: null, compare: false, optional: true},
onClick: {type: 'function', value: null, compare: false, optional: true},
Expand Down
6 changes: 0 additions & 6 deletions modules/core/src/passes/mask-pass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ export default class MaskPass extends LayersPass {
return layer.props.operation === OPERATION.MASK;
}

getModuleParameters() {
return {
drawToMaskMap: true
};
}

delete() {
this.fbo.delete();
this.maskMap.delete();
Expand Down
3 changes: 2 additions & 1 deletion modules/core/src/passes/pick-layers-pass.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import LayersPass, {LayersPassRenderOptions, RenderStats} from './layers-pass';
import {withParameters} from '@luma.gl/core';
import GL from '@luma.gl/constants';
import {OPERATION} from '../lib/constants';
import log from '../utils/log';

import type {Framebuffer} from '@luma.gl/core';
Expand Down Expand Up @@ -121,7 +122,7 @@ export default class PickLayersPass extends LayersPass {
}

protected shouldDrawLayer(layer: Layer): boolean {
return layer.props.pickable;
return layer.props.pickable && layer.props.operation === OPERATION.DRAW;
}

protected getModuleParameters() {
Expand Down

0 comments on commit 97be55a

Please sign in to comment.