Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large Icons when using fill colours in model tree and editor palette #396

Closed
rich-biker opened this issue Sep 11, 2018 · 13 comments
Closed

Comments

@rich-biker
Copy link

rich-biker commented Sep 11, 2018

Version of Archi, Operating System

Archi 4.0.3
Mac OS 10.13.6 (High Sierra)

I have removed the specialisation plug in, in case it was this. The behaviour is the same.

Expected Behaviour

Icons should remain the standard size, even if I change the default colours or choose to apply the fill colours to the model tree and editor palette.

Actual Behaviour

The icons on some of the shapes are the colours I set, but are way too large. The corresponding icons in the palette also do the same.
Changing the viewpoint seems to reset the icon size in the palette, but this came back later.

Steps to Reproduce the Behaviour

  1. Import the Mastering ArchiMate colour prefs (or just set your own, I guess?)
    (This made the palette icons go large. Changing the viewpoint helped, for a while)

  2. Set the 'Use Fill Colours in model tree and editor palette' setting in General
    (This made the icons on some of the same in a view go LARGE, and with the colour I set).

  3. Untick the same pref
    (This makes the icons go the correct size and default colour).

Dialog:

diaglog

Ticked:

largeicons

UnTicked:
unticked

Default Shapes
defaultshapes

Palatte:
pallate

Log File
archi_log.txt

@Phillipus
Copy link
Member

Assume you mean Archi 4.3?

Are you on Retina graphics? If so, right-click on Archi app and "Get Info" should show "Open in Low Resolution" as either checked not checked. Try changing this.

I don't know how you are getting a large icon and different color fill in the icon. Can you try with a clean installation of Archi (no plugins)

@Phillipus
Copy link
Member

I understand why the icons in the palette and the tree are displaying like this in hi-res.

The code to do this replaces any non-black pixel in the icon with the new pixel color as set in preferences. This makes the assumption that all lines in the icons are black (red: 0, green: 0, blue: 0)

However, in hi-res mode, the 2x version of the icon is used and these contain rasterised lines, which are shades of grey, and these pixels are also being coloured.

Clearly this method does not work with icons like this.

@Phillipus
Copy link
Member

Looking at the palette/tree icon problem further. This cannot be fixed. The 2x icons are not clear enough to do a simple color pixel replacement and will look messy. I'll have to disable this option.

As for the larger icons appearing in the diagram, I don't know what is causing this.

Note - I don't have access to a Retina Mac, so I can't test this.

@Phillipus Phillipus reopened this Sep 11, 2018
Phillipus added a commit that referenced this issue Sep 11, 2018
* This does not work at higher screen resolutions
* See #396
* Not possible to do this with icons
@Phillipus
Copy link
Member

Phillipus commented Sep 11, 2018

As for the large icons on the figures themselves I suspect this is caused by Herve's Specialisation plugin.

That plugin will display the 2x PNG icon on the figure even if you don't set your own icon. This over-rides Archi's drawing code that draws using Vector graphics.

To be sure, test with a clean install of Archi.

@herve91
Copy link

herve91 commented Sep 11, 2018

It is effectively possible. Please let me know ...

@Phillipus
Copy link
Member

@herve91

When you over-ride drawIcon() in your figures:

    @Override
    protected void drawIcon(Graphics graphics) {
        SpecializationPlugin.drawIcon(getDiagramModelObject(), graphics, this.bounds);
    }

This calls SpecializationPlugin.drawIcon() which then gets the image icon with:

Image image = ObjectUIFactory.INSTANCE.getProvider(obj).getImage();

So a 2x size icon will be drawn in the figure.

These icon images are really only meant to be drawn in the app (tree, palette) not on the diagram.

@herve91
Copy link

herve91 commented Sep 11, 2018

I see ...

I'll arrange to call super.drawIcon(graphics) if there is no need to replace the icon ...

Thanks for the information ...

@rich-biker
Copy link
Author

Yes, sorry, 4.3.0.
And Mac Book Pro Retina.

@Phillipus
Copy link
Member

@rich-biker OK, there are two issues here.

  1. The display in the palette and tree of custom colors won't work at hi-res. Next version of Archi will, unfortunately, not have this feature because it can't be done with the new 2x size icons (it was always a hack, anyway).
  2. The larger icons displaying in the view are caused by the Specialisation plug-in.

Suggest you uncheck the "Use Fill Colours in model tree and editor palette" preference,

@jbsarrodie
Copy link
Member

However, in hi-res mode, the 2x version of the icon is used and these contain rasterised lines, which are shades of grey, and these pixels are also being coloured.
Clearly this method does not work with icons like this.

No need to give up on this, it is enought to recreate 2x icons using a basic pixel doubling algorithm instead of other (usually better or nicer) algorithm.

@rich-biker
Copy link
Author

Thanks for all the feedback.

Note that for the screen shots I provided, I had already deinstalled the Specialisation plug-in, so I do not think that Herve's plugin was affecting this. I have now unticked the fill dialog, and have gone back to standard resolution on my retina MacBook. I've also added specialisation back in.
All ok for now, thanks.

@Phillipus
Copy link
Member

The only way that those icons can appear double sized and filled is with the Specialisation plugin installed. Archi itself uses a vector drawing method to draw the icons in code.

@jbsarrodie
Copy link
Member

The only way that those icons can appear double sized and filled is with the Specialisation plugin installed. Archi itself uses a vector drawing method to draw the icons in code.

I confirm. I already faced such rendering issue and this is clearly related to the specialization plugin which doesn't call the icon drawing code but instead uses the bitmap generated for the palette.

Note that for the screen shots I provided, I had already deinstalled the Specialisation plug-in, so I do not think that Herve's plugin was affecting this.

The plugin is not really uninstall, I bet you can see its name listed in Installation Details (menu Help > About Archi > Installation Details)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants