The Trunk: Collections-mt.887.mcz

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

The Trunk: Collections-mt.887.mcz

commits-2
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.887.mcz

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

Name: Collections-mt.887
Author: mt
Time: 20 April 2020, 9:41:19.032697 am
UUID: d0621830-e616-8342-9667-54921523e5a9
Ancestors: Collections-mt.886

Let <img> tags honor Squeak's "High DPI" setting.

=============== Diff against Collections-mt.886 ===============

Item was changed:
  ----- Method: HtmlReadWriter>>mapImgTag: (in category 'mapping') -----
  mapImgTag: aTag
 
  | result startIndex stopIndex attribute src form |
  result := OrderedCollection new.
 
  "<img src=""https://squeak.org/img/downloads/image.png"">"
  attribute := 'src'.
  startIndex := aTag findString: attribute.
  startIndex > 0 ifTrue: [
  startIndex := aTag findString: '"' startingAt: startIndex+attribute size.
  startIndex > 0
  ifTrue: [stopIndex := aTag findString: '"' startingAt: startIndex+1]
  ifFalse: [
  "URLs without quotes..."
  startIndex := aTag findString: '=' startingAt: startIndex+attribute size.
  stopIndex := aTag findString: '>' startingAt: startIndex+1].
  src := aTag copyFrom: startIndex+1 to: stopIndex-1.
  form := (self httpGetImage: src) ifNil: [(Form dotOfSize: 12 color: Color veryLightGray)].
  result
+ add: form scaleIconToDisplay asTextAnchor;
- add: form asTextAnchor;
  add: (TextColor color: Color transparent)].
  ^ result!