<commit_before>import {polygon as turfPolygon} from '@turf/helpers'
import GeometryType from '../geom/GeometryType.js';
import booleanOverlap from '@turf/boolean-overlap'
import Draw from './Draw.js';
import {DrawEvent} from './Draw.js';
import {DrawEventType} from './Draw.js';
import Circle from '../geom/Circle.js';
import Feature from '../Feature.js';
import Polygon from '../geom/Polygon.js'
import MapBrowserEventType from '../MapBrowserEventType.js';
import EventType from '../events/EventType.js';
import {shiftKeyOnly} from '../events/condition.js';
import {fromCircle} from '../geom/Polygon.js';
import {union} from '../geom/flat/union.js';
import {createEditingStyle} from '../style/Style.js';

class PolygonBrush extends Draw {

  constructor(options) {

    super(options);
    this.circleRadius_ = 10000  //TODO better value
    this.mode_ = null;
    this.overlay_.setStyle(options.style ? options.style : getDefaultStyleFunction());
  }

  handleEvent(event) {
    const type = event.type;
    let pass = true;
    if (shiftKeyOnly(event) && (type === EventType.WHEEL || type === EventType.MOUSEWHEEL)) {
      this.updateSketchPointRadius_(event);
    }

    if (event.type === MapBrowserEventType.POINTERDRAG && this.handlingDownUpSequence) {
      pass = false;
    }

    return super.handleEvent(event) && pass;
  }

  /**
   * @inheritDoc
   */
  handleDownEvent(event) {
    if (!this.handlingDownUpSequence) {
      this.startDrawing_(event);
      return true;<commit_msg>Fix stopping of event when sketch point radius is changed<commit_after>import {polygon as turfPolygon} from '@turf/helpers'
import GeometryType from '../geom/GeometryType.js';
import booleanOverlap from '@turf/boolean-overlap'
import Draw from './Draw.js';
import {DrawEvent} from './Draw.js';
import {DrawEventType} from './Draw.js';
import Circle from '../geom/Circle.js';
import Feature from '../Feature.js';
import Polygon from '../geom/Polygon.js'
import MapBrowserEventType from '../MapBrowserEventType.js';
import EventType from '../events/EventType.js';
import {shiftKeyOnly} from '../events/condition.js';
import {fromCircle} from '../geom/Polygon.js';
import {union} from '../geom/flat/union.js';
import {createEditingStyle} from '../style/Style.js';

class PolygonBrush extends Draw {

  constructor(options) {

    super(options);
    this.circleRadius_ = 10000  //TODO better value
    this.mode_ = null;
    this.overlay_.setStyle(options.style ? options.style : getDefaultStyleFunction());
  }

  handleEvent(event) {
    const type = event.type;
    let pass = true;
    if (shiftKeyOnly(event) && (type === EventType.WHEEL || type === EventType.MOUSEWHEEL)) {
      this.updateSketchPointRadius_(event);
      pass = false;
    }

    if (event.type === MapBrowserEventType.POINTERDRAG && this.handlingDownUpSequence) {
      pass = false;
    }

    return super.handleEvent(event) && pass;
  }

  /**
   * @inheritDoc
   */
  handleDownEvent(event) {
    if (!this.handlingDownUpSequence) {
      this.startDrawing_(event);
      return true;
{'fraction_non_alphanumeric': 0.14519293655984303, 'fraction_numerical': 0.0032701111837802484, 'mean_word_length': 3.7279752704791345, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5918007', 'n_tokens_mistral': 964, 'n_tokens_neox': 930, 'n_words': 226}