The Trunk: Graphics-tfel.326.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Graphics-tfel.326.mcz

commits-2
Tim Felgentreff uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-tfel.326.mcz

==================== Summary ====================

Name: Graphics-tfel.326
Author: tfel
Time: 19 February 2016, 2:17:46.541729 pm
UUID: 934ee205-38fd-4dcc-a877-b238d9e47a3a
Ancestors: Graphics-tfel.325

use VM primitive to flip screen buffers when drawing rectangles to the screen

=============== Diff against Graphics-tfel.325 ===============

Item was changed:
  ----- Method: Rectangle>>newRectButtonPressedDo: (in category 'transforming') -----
  newRectButtonPressedDo: newRectBlock
  "Track the outline of a new rectangle until mouse button
  changes. newFrameBlock produces each new rectangle from the
  previous. Only tracks while mouse is down."
  | rect newRect buttonNow delay |
  delay := Delay forMilliseconds: 10.
  buttonNow := Sensor anyButtonPressed.
  rect := self.
  Display
  border: rect
  width: 2
  rule: Form reverse
  fillColor: Color gray.
  [buttonNow]
  whileTrue: [delay wait.
  buttonNow := Sensor anyButtonPressed.
  newRect := newRectBlock value: rect.
  newRect = rect
  ifFalse: [Display
  border: rect
  width: 2
  rule: Form reverse
  fillColor: Color gray.
  Display
  border: newRect
  width: 2
  rule: Form reverse
  fillColor: Color gray.
+ Display forceToScreen.
  rect := newRect]].
  Display
  border: rect
  width: 2
  rule: Form reverse
  fillColor: Color gray.
  Project current pointerMoved.
  Sensor processEvent: Sensor createMouseEvent.
  ^ rect!

Item was changed:
  ----- Method: Rectangle>>newRectFrom: (in category 'transforming') -----
  newRectFrom: newRectBlock
  "Track the outline of a new rectangle until mouse button changes.
  newFrameBlock produces each new rectangle from the previous"
  | rect newRect buttonStart buttonNow delay |
  delay := Delay forMilliseconds: 10.
  buttonStart := buttonNow := Sensor anyButtonPressed.
  rect := self.
  Display border: rect width: 2 rule: Form reverse fillColor: Color gray.
  [buttonNow == buttonStart] whileTrue:
  [delay wait.
  buttonNow := Sensor anyButtonPressed.
  newRect := newRectBlock value: rect.
  newRect = rect ifFalse:
  [Display border: rect width: 2 rule: Form reverse fillColor: Color gray.
  Display border: newRect width: 2 rule: Form reverse fillColor: Color gray.
+ Display forceToScreen.
  rect := newRect]].
  Display border: rect width: 2 rule: Form reverse fillColor: Color gray.
  Project current pointerMoved.
  Sensor processEvent: Sensor createMouseEvent.
  ^ rect!