MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / drawItem

Method drawItem

src/main/java/Client/SmilePicker.java:125–143  ·  view source on GitHub ↗
(Graphics g, int ofs, boolean selected)

Source from the content-addressed store, hash-verified

123 }
124
125 public void drawItem(Graphics g, int ofs, boolean selected){
126 int max=(lineIndex==lines-1)? xLastCnt:xCnt;
127 int x, iwidth;
128
129//#ifdef ANI_SMILES
130 AniIcon item;
131//#endif
132 for (int i=0;i<max;i++) {
133 x = xBorder+(i*imgWidth+CURSOR_HOFFSET);
134//#ifdef ANI_SMILES
135 if (il instanceof AniImageList) {
136 item = ((AniImageList)il).iconAt(lineIndex*xCnt + i);
137 iwidth = (item == null)? 0 : item.getWidth();
138 x += (imgWidth - iwidth) >> 1;
139 }
140//#endif
141 il.drawImage(g, lineIndex*xCnt + i, x, CURSOR_VOFFSET);
142 }
143 }
144
145 protected synchronized int updateLayout() {
146 int res = super.updateLayout();

Callers

nothing calls this directly

Calls 3

getWidthMethod · 0.95
iconAtMethod · 0.80
drawImageMethod · 0.45

Tested by

no test coverage detected