It works by itself but not part of the selectTool, I get a fatal error and the plugin quits, the only difference is the scale line:
see my package and line 56-68:
try:
x, y = 100, 100
Scale = Glyphs.font.currentTab.scale
circleCursorImage = NSImage.alloc().initWithSize_(NSMakeSize(x*Scale, y*Scale))
circleCursorImage.lockFocus()
rect = NSMakeRect(1, 1, x*Scale-2, y*Scale-2)
circleCursorColor = 0.5, 0.5, 0.5, 0.9
NSColor.colorWithCalibratedRed_green_blue_alpha_( *circleCursorColor ).set()
NSBezierPath.bezierPathWithOvalInRect_(rect).fill()
circleCursorImage.unlockFocus()
circleCursor = NSCursor.alloc().initWithImage_hotSpot_(circleCursorImage, NSMakePoint(x/2*Scale, y/2*Scale))
except Exception as e:
self.logToConsole( "gaugeTool circleCursorImage: %s" % str(e) )
Here is a refined version of your plugin: GaugeTool.glyphsTool.zip (776.5 KB)
I hope that it works for none Retina setups.
thank you very much i will have a look, what would it need to work for retina setups? would it need for retina screens?
My machine has a Retina screen so I canât test if it works for machines that have only standard resolution screens.
1 Like
And I added a sample plugin that shows how to build multi tool plugins to the GlyphsSDK page. I used your plugin as a basis and removed all of your code pieces.
2 Likes
etunni
(etunni)
June 6, 2016, 1:04pm
26
Hi, thanks for this plugin, is useful.
My machine donât have retina and I can use it.
How can I do to change de value of circle?
Mark
(Mark Frömberg aka Mark2Mark)
June 6, 2016, 1:15pm
27
Apparently it reads the values from the Dimensions you define in the Palette.
Cool! is it possible to make the shortcut work such that c, or Shift+C changes the tool being selected?
Also anyone have any idea why the color changes from purple to red depending on how far Iâm zoomed in, it should be red all the time, the RGBs are (0.5, 0, 0, 0.4)
http://quick.as/ox3gtlvdj
RGB should only have 3 values; you have 4.
The sample plugin has all parts that are needed. You need to set the âkeyboardshortcutâ in âsettings()â and implement the âselectNextSubtool()â method.
1 Like
Itâs not working, see this, also tried it in the SDK sample
The sample plugin crashes my glyphs app:
self._icon = None
I know this line crashes my own plugin?
True, I changed something in the wrapper. Remove it until I publish the next update.
also the selectNextSubtool
?
No, selectNextSubtool()
should work. I fixed to sample plugin to work in version 2.3 (895). Hitting shift+X switches between the tools.
youâre right it does work, i didnât realise i had to put in the other tool under it!
I didnât realise there are open questions?