<commit_before>define [
  'controllers/tool'
  'models/commands/create_node'
], (Tool, CreateNode) ->

  class NodeTool extends Tool
    parameters: {'shape' : null}
  
    onMouseDown: (event) =>
      if @parameters.shape
        @parameters.position = event.point
        @run(new CreateNode(@drawing, @parameters))
        @clearSelection()
      
    onMouseMove: (event) =>
      if @parameters.shape
        @clearSelection()
        @select(@hitTester.nodeAt(event.point))<commit_msg>Ensure that new nodes are created with positions that serialise correctly. Previously, we set a node's initial position to a Point object, but we only need to store the x and y co-ordinates.<commit_after>define [
  'controllers/tool'
  'models/commands/create_node'
], (Tool, CreateNode) ->

  class NodeTool extends Tool
    parameters: {'shape' : null}
  
    onMouseDown: (event) =>
      if @parameters.shape
        @parameters.position = { x: event.point.x, y: event.point.y }
        @run(new CreateNode(@drawing, @parameters))
        @clearSelection()
      
    onMouseMove: (event) =>
      if @parameters.shape
        @clearSelection()
        @select(@hitTester.nodeAt(event.point))
{'fraction_non_alphanumeric': 0.11952861952861953, 'fraction_numerical': 0.0, 'mean_word_length': 3.04421768707483, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2752251', 'n_tokens_mistral': 352, 'n_tokens_neox': 350, 'n_words': 90}