Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

[[ MyPixelScale ]] Implement my pixel scale expression#6337

Merged
livecodeali merged 1 commit into
livecode:developfrom
montegoulding:feature-my_pixel_scale
Feb 20, 2018
Merged

[[ MyPixelScale ]] Implement my pixel scale expression#6337
livecodeali merged 1 commit into
livecode:developfrom
montegoulding:feature-my_pixel_scale

Conversation

@montegoulding

Copy link
Copy Markdown
Contributor

This patch implements my pixel scale as an expression for
widgets to determine the current backing scale of the stack
they are on.

This patch implements `my pixel scale` as an expression for
widgets to determine the current backing scale of the stack
they are on.
@montegoulding montegoulding added this to the 9.0.0-rc-1 milestone Feb 20, 2018
@montegoulding

Copy link
Copy Markdown
Contributor Author

I don't think this can be tested very easily without manual intervention. Locally I created a widget as follows:

widget com.livecode.widget.pixelscale

use com.livecode.canvas
use com.livecode.widget
use com.livecode.library.widgetutils

constant kIcon is "M1312 256h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113v-832q0-66-47-113t-113-47zm288 160v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"
public handler OnPaint() returns nothing
      variable tScale as String
      put my pixel scale formatted as string into tScale
      paintPlaceholderImage(this canvas, my bounds, kIcon, \
         tScale, nothing, nothing)
         
end handler

end widget

Then dragged it between retina and regular screen and it showed 2 for retina and 1 for regular as expected. Once the window was released on the different density screen it was repainted.

@livecodeali

Copy link
Copy Markdown
Member

@livecode-vulcan review ok f12d88c

@livecode-vulcan

Copy link
Copy Markdown
Contributor

💙 review by @livecodeali ok f12d88c

livecode-vulcan added a commit that referenced this pull request Feb 20, 2018
[[ MyPixelScale ]] Implement my pixel scale expression

This patch implements `my pixel scale` as an expression for
widgets to determine the current backing scale of the stack
they are on.
@livecode-vulcan

Copy link
Copy Markdown
Contributor

😎 test success f12d88c

  • try-community-armv6-android-api8: success
  • try-community-armv6-android-api9: success
  • try-community-js-emscripten-sdk1.35: success
  • try-community-universal-ios-iphoneos11.2: success
  • try-community-universal-ios-iphonesimulator11.2: success
  • try-community-universal-mac-macosx10.6: success
  • try-community-universal-mac-macosx10.9: success
  • try-community-x86-linux-debian7: success
  • try-community-x86-linux-debian8: success
  • try-community-x86_64-linux-debian7: success
  • try-community-x86_64-linux-debian8: success
  • try-community-x86-win32: success
  • try-community-x86_64-win32: success

@livecodeali livecodeali merged commit a828893 into livecode:develop Feb 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants