make Inlay.updateSize() imply Inlay.repaint()

otherwise clients would always need to call the latter after the former
This commit is contained in:
Dmitry Batrak
2018-07-09 18:21:54 +03:00
parent 6d181d6eee
commit 93035db9e1
3 changed files with 8 additions and 3 deletions
@@ -58,9 +58,10 @@ public interface Inlay extends Disposable, UserDataHolderEx {
int getWidthInPixels();
/**
* Updates inlay's size by querying information from inlay's renderer.
* Updates inlay's size by querying information from inlay's renderer. Also, repaint the inlay.
*
* @see EditorCustomElementRenderer#calcWidthInPixels(Editor)
* @see #repaint()
*/
void updateSize();
@@ -105,7 +105,6 @@ public class ParameterHintsPresentationManager implements Disposable {
MyRenderer renderer = (MyRenderer)hint.getRenderer();
renderer.update(editor, newText, useAnimation);
hint.updateSize();
hint.repaint();
if (useAnimation) scheduleRendererUpdate(editor, hint);
}
@@ -38,7 +38,12 @@ class InlayImpl extends RangeMarkerImpl implements Inlay, Getter<InlayImpl> {
public void updateSize() {
int oldWidth = myWidthInPixels;
doUpdateSize();
if (oldWidth != myWidthInPixels) myEditor.getInlayModel().notifyChanged(this);
if (oldWidth != myWidthInPixels) {
myEditor.getInlayModel().notifyChanged(this);
}
else {
repaint();
}
}
@Override